Hello, I am creating a scene composed of two objects : - A (yellow) submarine, and a osg::ShapeDrawable created from an osg::HeightField : The Seabed.
I use a spot light to illuminate this scene. The spot light is positinoned 1 meter above the submarine, the submarine is 10 meters above the seabed. My Submarine is a 3ds file correctly imported. My light is defined as : Code: osg::ref_ptr< osg::LightSource >m_spotAvant; osg::ref_ptr< osg::Light> m_lumSpotAvant; m_spotAvant = new LightSource; m_lumSpotAvant = m_spotAvant->getLight(); m_lumSpotAvant->setLightNum(0); m_lumSpotAvant->setPosition(Vec4f(0,0,-89,1)); m_lumSpotAvant->setDirection(Vec3f(0,0,-1)); m_lumSpotAvant->setSpotCutoff(90.); m_lumSpotAvant->setSpotExponent(50); m_lumSpotAvant->setConstantAttenuation(0.1); m_lumSpotAvant->setDiffuse(osg::Vec4(1.0f,0.0f,1.0f,1.0f)); m_spotAvant->setLocalStateSetModes(osg::StateAttribute::ON); I suppose to have a part of my submarine illuminated (because of the spotCutOff and the Spot exponent), and part of the seabed illuminated to. My Submarine is illuminated, but not the sea bed... It is completly black ! I decide to positione a cylinder created in this way : Code: osg::ref_ptr< osg::Cylinder > m_testCylindre = new osg::Cylinder(osg::Vec3f(0,0,-95), 5, 2); osg::ref_ptr< osg::Geode> m_gCylindre = new Geode; m_gCylindre->addDrawable(new osg::ShapeDrawable(m_testCylindre)); scene->addChild(m_gCylindre); So this cylinder is 5 meter below the submarine, and 5 meter above the seabed. The cylinder is well illuminated ! So why my cylinder is well illuminated, and not my seabed ? Both objects are osg::ShapeDrawable... Of course I try to find answer to this question looking in the OSG Examples. I try to run the osgspotlight example, and this sample seems to have the same behaviour. The HeightMaps is black, I can't see the spot light ! Best regards, A. BARRAL. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31926#31926 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

