Hi,
In my application, I'm trying to create a point (a small sphere) and
alter its properties, like shininess and transparency. When I execute the
following method, the point is created with shininess effects alright.
However, no matter how much I change the values related to transparency
(values from 0. to 1.), nothing seems to be different in my view...
What do I have to do to get the right result?
osg::Geode* Point::createPoint(osg::Vec3f position)
{
this->geode = new osg::Geode() // geode is an
osg::ref_ptr<osg::Geode>, member of my class
this->drawable = new osg::ShapeDrawable(new
osg::Sphere(position, RADIUS)); // drawable is an
// osg::ref_ptr<osg::Drawable>, member
of my class
this->drawable->setColor(osg::Vec4(0.0, 0.0, 1.0, 1.0));
this->geode->addDrawable(this->drawable);
this->material -> setColorMode(osg::Material::DIFFUSE);
this->material -> setAmbient(osg::Material::FRONT_AND_BACK,
osg::Vec4(1, 1, 1, 1));
this->material -> setSpecular(osg::Material::FRONT_AND_BACK,
osg::Vec4(1, 1, 1, 1));
this->material ->
setShininess(osg::Material::FRONT_AND_BACK, 128.0f);
this->material ->
setTransparency(osg::Material::FRONT_AND_BACK, 0.5f);
geode -> getOrCreateStateSet() ->
setAttributeAndModes(this->material.get(), osg::StateAttribute::ON);
return geode.get();
}
Thanks for your help,
Renan
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org