fixed bug in material definitions, added them to cyls.fart, they are working now!

git-svn-id: svn://anubis/fart/trunk@179 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-03-03 03:06:56 +00:00
parent 31e2604f98
commit bb5eb07c75
4 changed files with 44 additions and 10 deletions

1
.todo
View File

@ -1,7 +1,6 @@
FART To-Do List
===============
- Make verbose default
- Material definitions
- Recurse for reflection
- Continue for transparency
- Scan for cameras before scene items

View File

@ -193,6 +193,7 @@ void Scene::processMaterialDefinition(refptr<Node> node)
m_materials.find(node->getString());
if ( it == m_materials.end() )
{
cout << "Creating material " << node->getString() << endl;
m_materials[node->getString()] = processMaterial(node);
}
else

View File

@ -239,9 +239,9 @@ material_item: COLOR vector {
}
;
material_definition: MATERIAL IDENTIFIER LCURLY material_items RCURLY {
$$ = new MaterialDefinitionNode($2->getString());
$$->addChildren($3);
material_definition: DEFINE MATERIAL IDENTIFIER LCURLY material_items RCURLY {
$$ = new MaterialDefinitionNode($3->getString());
$$->addChildren($5);
}
;

View File

@ -20,6 +20,11 @@ scene
position <3, -8, 5>
}
define material cyan
{
color <0, 1, 1>
}
plane
{
position <0, 0, 1>, 0
@ -39,11 +44,40 @@ scene
color <1.0, 0.6, 0>
}
}
cyl { size <0.2, 0, 0.3> translate <0, 0, 0.3> }
cyl { size <0.2, 0, 0.3> rotate 90, <1, 0, 0> translate <0, 0, 0.3> }
cyl { size <0.2, 0, 0.3> rotate -90, <1, 0, 0> translate <0, 0, 0.3> }
cyl { size <0.2, 0, 0.3> rotate 180, <1, 0, 0> translate <0, 0, 0.3> }
cyl { size <0.2, 0, 0.3> rotate 90, <0, 1, 0> translate <0, 0, 0.3> }
cyl { size <0.2, 0, 0.3> rotate -90, <0, 1, 0> translate <0, 0, 0.3> }
cyl {
size <0.2, 0, 0.3>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate 90, <1, 0, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate -90, <1, 0, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate 180, <1, 0, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate 90, <0, 1, 0>
translate <0, 0, 0.3>
material cyan
}
cyl {
size <0.2, 0, 0.3>
rotate -90, <0, 1, 0>
translate <0, 0, 0.3>
material cyan
}
}
}