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:
parent
84f6b04cd7
commit
10500d08aa
@ -266,8 +266,10 @@ class UpNode : public VectorNode
|
|||||||
UpNode(refptr<Vector> vector) : VectorNode(vector) {}
|
UpNode(refptr<Vector> vector) : VectorNode(vector) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class VFOVNode : public Node
|
class VFOVNode : public NumberNode
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
VFOVNode(double d) : NumberNode(d) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class WidthNode : public IntegerNode
|
class WidthNode : public IntegerNode
|
||||||
|
@ -141,9 +141,8 @@ camera_item: POSITION vector {
|
|||||||
| UP vector {
|
| UP vector {
|
||||||
$$ = new UpNode($2->getVector());
|
$$ = new UpNode($2->getVector());
|
||||||
}
|
}
|
||||||
| VFOV vector {
|
| VFOV number {
|
||||||
$$ = new VFOVNode();
|
$$ = new VFOVNode($2->getNumber());
|
||||||
$$->addChild($2);
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -329,7 +328,7 @@ shape_item: material { $$ = $1; }
|
|||||||
|
|
||||||
sphere: SPHERE LCURLY sphere_items RCURLY {
|
sphere: SPHERE LCURLY sphere_items RCURLY {
|
||||||
$$ = new SphereNode();
|
$$ = new SphereNode();
|
||||||
$$->addChild($3);
|
$$->addChildren($3);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -10,21 +10,21 @@ scene
|
|||||||
|
|
||||||
camera
|
camera
|
||||||
{
|
{
|
||||||
position <0, -2, 0>
|
position <0, -1.9, 0>
|
||||||
look_at <0, 0, 0>
|
look_at <0, 0, 0>
|
||||||
up <0, 0, 1>
|
up <0, 0, 1>
|
||||||
}
|
}
|
||||||
|
|
||||||
plane { position <1, 0, 0>, -2 }
|
plane { position <1, 0, 0>, 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, -1, 0>, -2 }
|
plane { position <0, -1, 0>, 2 }
|
||||||
plane { position <0, 0, 1>, -2 }
|
plane { position <0, 0, 1>, 2 }
|
||||||
plane { position <0, 0, -1>, -2 }
|
plane { position <0, 0, -1>, 2 }
|
||||||
|
|
||||||
sphere
|
sphere
|
||||||
{
|
{
|
||||||
radius 1.0
|
radius 0.5
|
||||||
material
|
material
|
||||||
{
|
{
|
||||||
reflectance 0.2
|
reflectance 0.2
|
||||||
@ -33,4 +33,9 @@ scene
|
|||||||
shininess 80
|
shininess 80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
light
|
||||||
|
{
|
||||||
|
position <1, -1, 1>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user