A SERVICE OF

logo

Cube.cxx Explained
201
highlight = new csAppearance;
highlight->setMaterial(hlMaterial);
highlight->setLightEnable(1);
// red cube
csMaterial *redMaterial = new csMaterial;
redMaterial->setSpecularColor(1.0f, 1.0f, 1.0f);
redMaterial->setDiffuseColor(0.8f, 0.1f, 0.1f);
redMaterial->setShininess(.0078125 *16.0f);
redMaterial->setTransparency(0.5f);
csAppearance *redAppearance = new csAppearance;
redAppearance->setMaterial(redMaterial);
redAppearance->setLightEnable(1);
redAppearance->setTranspMode(csContext::BLEND_TRANSP);
redAppearance->setTranspEnable(1);
csShape *redShape = new csShape;
redShape->setAppearance(redAppearance);
redShape->setGeometry(0, gset);
bgTransform = new csTransform;
bgTransform->setTranslation(0.0f, 0.0f, -5.0f);
bgTransform->addChild(redShape);
// green cube
csMaterial *greenMaterial = new csMaterial;
greenMaterial->setDiffuseColor(0.1f, 0.8f, 0.1f);
greenMaterial->setShininess(.0078125 *16.0f);
greenMaterial->setTransparency(0.5f);
csAppearance *greenAppearance = new csAppearance;
greenAppearance->setMaterial(greenMaterial);
greenAppearance->setLightEnable(1);
greenAppearance->setTranspMode(csContext::BLEND_TRANSP);
greenAppearance->setTranspEnable(1);
csShape *greenShape = new csShape;
greenShape->setAppearance(greenAppearance);
greenShape->setGeometry(0, gset);
fgTransform = new csTransform;
fgTransform->setTranslation(0.5f, 0.1f, -6.0f);
fgTransform->addChild(greenShape);