added Color::yellow, finished shapes/Box, added a couple boxes to sample scene
git-svn-id: svn://anubis/fart/trunk@121 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
1 parent
13fedccf4c
commit
4b0f506522
5 files changed
+29
-4
No files matched your search
+23
-1
@@ -79,7 +79,7 @@ void Scene::load(const char * filename)
|
||||
refptr<Shape> plane = new Plane(0, 0, 1, -2);
|
||||
m_shapes.push_back(plane);
|
||||
|
||||
Material * m = new Material();
|
||||
refptr<Material> m = new Material();
|
||||
m->setDiffuseColor(Color::red);
|
||||
m->setAmbientColor(Color::red);
|
||||
|
||||
@@ -89,6 +89,28 @@ void Scene::load(const char * filename)
|
||||
shape->setMaterial(m);
|
||||
m_shapes.push_back(shape);
|
||||
|
||||
m = new Material();
|
||||
m->setDiffuseColor(Color::blue);
|
||||
m->setAmbientColor(Color::blue);
|
||||
|
||||
shape = new Box(new Vector(1.8, 1.8, 0.5));
|
||||
m_transform.translate(0, 0, -2.0);
|
||||
shape->setTransform(m_transform);
|
||||
shape->setMaterial(m);
|
||||
m_shapes.push_back(shape);
|
||||
|
||||
m = new Material();
|
||||
m->setDiffuseColor(Color::yellow);
|
||||
m->setAmbientColor(Color::yellow);
|
||||
|
||||
shape = new Box(new Vector(1, 1, 1));
|
||||
m_transform.translate(-3, 1, 0.5);
|
||||
m_transform.rotate(45, 0, 0, 1);
|
||||
m_transform.rotate(45, 1, 0, 0);
|
||||
shape->setTransform(m_transform);
|
||||
shape->setMaterial(m);
|
||||
m_shapes.push_back(shape);
|
||||
|
||||
refptr<Light> light = new PointLight();
|
||||
light->setPosition(Vector(2, -1, 2));
|
||||
m_lights.push_back(light);
|
||||
|
||||
Reference in new issue
Block a user