diff --git a/main/Scene.cc b/main/Scene.cc index 5ec98b7..cf04eea 100644 --- a/main/Scene.cc +++ b/main/Scene.cc @@ -141,12 +141,24 @@ void Scene::load(const char * filename) shape->setMaterial(m); m_shapes.push_back(shape); + m = new Material(); + m->setDiffuseColor(Color::cyan); + m->setAmbientColor(Color::cyan); + + shape = new Cyl(1.0, 0.0, 2.0); + m_transform.translate(-1.3, 2.5, 3.5); + m_transform.rotate(45, 1, 0, 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, 1, 0, 0); + m_transform.translate(-1.7, -0.5, -2.0); m_transform.rotate(45, 0, 0, 1); m_transform.rotate(45, 1, 0, 0); shape->setTransform(m_transform); diff --git a/util/Color.cc b/util/Color.cc index 22b56da..92bec6f 100644 --- a/util/Color.cc +++ b/util/Color.cc @@ -7,6 +7,7 @@ const Color Color::red = Color(1, 0, 0); const Color Color::green = Color(0, 1, 0); const Color Color::blue = Color(0, 0, 1); const Color Color::yellow = Color(1, 1, 0); +const Color Color::cyan = Color(0, 1, 1); Color::Color() { diff --git a/util/Color.h b/util/Color.h index 4aad11b..c50832a 100644 --- a/util/Color.h +++ b/util/Color.h @@ -26,6 +26,7 @@ class Color static const Color green; static const Color blue; static const Color yellow; + static const Color cyan; }; Color operator+(const Color & c1, const Color & c2);