diff --git a/parser/nodes.h b/parser/nodes.h index fdcd6f5..552224b 100644 --- a/parser/nodes.h +++ b/parser/nodes.h @@ -266,8 +266,10 @@ class UpNode : public VectorNode UpNode(refptr vector) : VectorNode(vector) {} }; -class VFOVNode : public Node +class VFOVNode : public NumberNode { + public: + VFOVNode(double d) : NumberNode(d) {} }; class WidthNode : public IntegerNode diff --git a/parser/parser.yy b/parser/parser.yy index 8d38256..1824b09 100644 --- a/parser/parser.yy +++ b/parser/parser.yy @@ -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); } ; diff --git a/scenes/infinity.fart b/scenes/infinity.fart index 94850b5..c5dfcd9 100644 --- a/scenes/infinity.fart +++ b/scenes/infinity.fart @@ -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> + } }