HI Michele, You are being caught out by the OSG enabling small feature culling by default, you can fake a large bounding volume as suggested by Paul or simply disable small feature culling via:
viewer.getCamera()->setCullingMode(viewer.getCamera()->getCullingMode() & ~osg::CullSetttings::SMALL_FEATURE_CULLING); The esoteric syntax is down to CullingMode being a bit mask, have a browse through include/osg/CullingSetting for more details. Robert. On Nov 27, 2007 5:31 PM, Michele Bosi <[EMAIL PROTECTED]> wrote: > Hello, I have an interesting problem here: when I try to draw a > Geometry containing a single point it doesn't get drawn, if the > geometry has two points distant enough they will get shown, it looks > like if there is some kind of "detail culling" which things that a > single point or two close points shouldn't be drawn. My system is a > simple Ubuntu 7 and Mesa OpenGL (no hardware drivers used). > > Here's the code: > > // this geometry represents a single atom, that's why it's a point > osg::ref_ptr<osg::Geometry> pointGeom = new osg::Geometry(); > > osg::ref_ptr<osg::Vec3Array> pointVert = new osg::Vec3Array(); > osg::Vec3 v = toOSG(atomData()->position()); > pointVert->push_back( v ); > pointVert->push_back( v + osg::Vec3f(0,0,0.1) ); // > <------------------ if i put osg::Vec3f(0,0,0.2) or more the geometry > is drawn otherwise is not drawn > pointGeom->setVertexArray(pointVert.get()); > > osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array; > colors->push_back( toOSG( color() ) ); > pointGeom->setColorArray(colors.get()); > pointGeom->setColorBinding(osg::Geometry::BIND_OVERALL); > > pointGeom->addPrimitiveSet( new > osg::DrawArrays(osg::PrimitiveSet::POINTS, 0, pointVert->size()) ); > > // geode > osg::Geode* geode = new osg::Geode; > osgGroup()->addChild(geode); > > // states > geode->getOrCreateStateSet()->setMode(GL_LIGHTING, > osg::StateAttribute::OFF); > > osg::ref_ptr<osg::Point> point = new osg::Point; > point->setSize( pointSize() ); > geode->getOrCreateStateSet()->setAttribute(point.get(), > osg::StateAttribute::ON); > > > am I missing something very obvious here? it's a bug or something else? > > Regards, > Michele > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

