added static const cyan color, added cone to sample scene

git-svn-id: svn://anubis/fart/trunk@134 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-02-19 18:30:02 +00:00
parent 2b1603cf26
commit 52103bf543
3 changed files with 15 additions and 1 deletions

View File

@ -141,12 +141,24 @@ void Scene::load(const char * filename)
shape->setMaterial(m); shape->setMaterial(m);
m_shapes.push_back(shape); 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 = new Material();
m->setDiffuseColor(Color::yellow); m->setDiffuseColor(Color::yellow);
m->setAmbientColor(Color::yellow); m->setAmbientColor(Color::yellow);
shape = new Box(new Vector(1, 1, 1)); 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, 0, 0, 1);
m_transform.rotate(45, 1, 0, 0); m_transform.rotate(45, 1, 0, 0);
shape->setTransform(m_transform); shape->setTransform(m_transform);

View File

@ -7,6 +7,7 @@ const Color Color::red = Color(1, 0, 0);
const Color Color::green = Color(0, 1, 0); const Color Color::green = Color(0, 1, 0);
const Color Color::blue = Color(0, 0, 1); const Color Color::blue = Color(0, 0, 1);
const Color Color::yellow = Color(1, 1, 0); const Color Color::yellow = Color(1, 1, 0);
const Color Color::cyan = Color(0, 1, 1);
Color::Color() Color::Color()
{ {

View File

@ -26,6 +26,7 @@ class Color
static const Color green; static const Color green;
static const Color blue; static const Color blue;
static const Color yellow; static const Color yellow;
static const Color cyan;
}; };
Color operator+(const Color & c1, const Color & c2); Color operator+(const Color & c1, const Color & c2);