fixed parser bug with sphere_items, made VFOVNode inherit from NumberNode, updated sample scene infinity.fart, reading scene from a file appears to be working!

git-svn-id: svn://anubis/fart/trunk@175 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-03-02 00:25:41 +00:00
parent 84f6b04cd7
commit 10500d08aa
3 changed files with 19 additions and 13 deletions

View File

@ -266,8 +266,10 @@ class UpNode : public VectorNode
UpNode(refptr<Vector> vector) : VectorNode(vector) {}
};
class VFOVNode : public Node
class VFOVNode : public NumberNode
{
public:
VFOVNode(double d) : NumberNode(d) {}
};
class WidthNode : public IntegerNode

View File

@ -141,9 +141,8 @@ camera_item: POSITION vector {
| UP vector {
$$ = new UpNode($2->getVector());
}
| VFOV vector {
$$ = new VFOVNode();
$$->addChild($2);
| VFOV number {
$$ = new VFOVNode($2->getNumber());
}
;
@ -329,7 +328,7 @@ shape_item: material { $$ = $1; }
sphere: SPHERE LCURLY sphere_items RCURLY {
$$ = new SphereNode();
$$->addChild($3);
$$->addChildren($3);
}
;

View File

@ -10,21 +10,21 @@ scene
camera
{
position <0, -2, 0>
position <0, -1.9, 0>
look_at <0, 0, 0>
up <0, 0, 1>
}
plane { position <1, 0, 0>, -2 }
plane { position <-1, 0, 0>, -2 }
plane { position <0, 1, 0>, -2 }
plane { position <0, -1, 0>, -2 }
plane { position <0, 0, 1>, -2 }
plane { position <0, 0, -1>, -2 }
plane { position <1, 0, 0>, 2 }
plane { position <-1, 0, 0>, 2 }
plane { position <0, 1, 0>, 2 }
plane { position <0, -1, 0>, 2 }
plane { position <0, 0, 1>, 2 }
plane { position <0, 0, -1>, 2 }
sphere
{
radius 1.0
radius 0.5
material
{
reflectance 0.2
@ -33,4 +33,9 @@ scene
shininess 80
}
}
light
{
position <1, -1, 1>
}
}