A single point occupies no space, therefore its bounding volume is zero and
it is culled away.

Take a look at the setInitialBound() method, which allows you to specify an
initial small but non-zero bounding volume for your Geometry/Drawable. I've
used this successfully in the past to get around this very problem.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466



> 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-opensce
negraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to