Hi all
Accept my apology for such a simple question. I want to display two coincident 
points at (0,0,0). I use code like this:

int main()
{
    osgViewer::Viewer viewer;

    osg::ref_ptr<osg::Group> root (new osg::Group);
    osg::ref_ptr<osg::Geode> geode (new osg::Geode());
    osg::ref_ptr<osg::Geometry> geometry (new osg::Geometry());

    osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());

    vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
    vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));

    geometry->setVertexArray (vertices.get());

    geometry->addPrimitiveSet(new 
osg::DrawArrays(osg::PrimitiveSet::POINTS,0,vertices->size()));

    osg::Point *point=new osg::Point;
    point->setSize(4);
    root->getOrCreateStateSet()->setAttribute(point);

    geode->addDrawable (geometry.get());
    root->addChild(geode.get());
    viewer.setSceneData( root.get() );

    return (viewer.run());
}

But it displays nothing. I think it relates to BoundingBox and culling, so what 
should I do to display two coincident points at (0,0,0)? And how to do it for 
just one point?

Regards, Moji




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

Reply via email to