On 12/02/2011 04:40 AM, Anders Backman wrote:
Yes, which is what I wrote:
"What is the idea behind having a color in ShapeDrawable?"
I cant see any reason why there would be a color associated to a shape?
Create a triangle, and by the way, its red. That was my question.
So if you WOULD like to control the color by disabling light and use
diffuse, it will not work.
It will be white (due to the call in ShapeDrawable).
I don't understand what you mean here. If you disable lighting,
material colors are irrelevant. The ShapeDrawable's colors are the ONLY
way to set the color.
Anyway, there are ways around this. I just thought it was very
inconsistent to associate a color to a ShapeDrawable.
I'm not sure what's inconsistent about it. It behaves like any other
OpenGL geometry.
As Filip indicated, the color only applies if lighting is disabled.
When you disable lighting, no lighting calculations are done, and
material colors become irrelevant, just as they do with any OpenGL
rendering when lighting is disabled. Only the geometry color is used.
If you want an unlit red cube, this is how you'd do it.
When lighting is enabled, the material can be set to either ignore the
geometry colors:
material->setColorMode(osg::Material::OFF);
or to use the geometry colors as one of the material colors:
material->setColorMode(osg::Material::DIFFUSE); (for example)
It's your choice how you want to apply the material.
--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org