set color
hello!
I am using the 'my device' code and I'm creating a cylinder, but when I'm trying to rotate the object about its axis, I'm losing the option to change its color and it's becoming gray.
cylinder0 = new cShapeCylinder(rad, rad, height);
world->addChild(cylinder0);
// set position and orientation
cylinder0->setLocalPos(height/2,0.0, 0.0);
cylinder0->rotateAboutGlobalAxisDeg(cVector3d(0.0, 1.0, 0.0),90);
// set material color
cylinder0->m_material->setBlueCornflower();
// cylinder0->createEffectSurface();
cylinder0->setTransparencyLevel(0.5);
thanks a lot for the help!
Please Log in or Create an account to join the conversation.
- Posts: 27
I think its because of your direction of lighting. No light is reflected from the cylinder to the camera.
I am assuming that you have "light->setDir(-1.0, 0.0, 0.0)" in your code.
change your direction of your light source -- may be "light->setDir(1.0, 0.0, 0.0)" and see.
Hope this helps.
Please Log in or Create an account to join the conversation.
Thank you
It works!
Please Log in or Create an account to join the conversation.