Geometry disappeared

classic Classic list List threaded Threaded
2 messages Options
OsgEarth_luo OsgEarth_luo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Geometry disappeared

I drew a line and a cone, and i zoomed in the scene to some extents, the line or the cone just disappeared, and it appeared agian when i zoomed out them, Why?
I had set up "m_pVview->getCamera () ->setNearFarRatio (0.0000001)";

This is my code:
        osg::ref_ptr<osg::Cone>  cone = new osg::Cone;
        osg::ref_ptr<osg::ShapeDrawable> shap = new osg::ShapeDrawable(cone);
        osg::ref_ptr<osg::Geode> geode = new osg::Geode;
        geode->addDrawable(shap);
        mtObject.addChild(geode);

        cone->setHeight(200.0);
        cone->setRadius(300);
        Testcone = cone;
        shap->setColor(osg::Vec4(1.0, 0.0, 0.0, 0.25));

        osg::ref_ptr<osg::StateSet> stateset = geode->getOrCreateStateSet();
        stateset->setMode(GL_BLEND, osg::StateAttribute::ON);
        stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);


        osg::ref_ptr<osg::PolygonMode> polyMode = new osg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL);
        stateset->setAttribute(polyMode);

examyes examyes
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Geometry disappeared

try:
camera->setSmallFeatureCullingPixelSize(-1);
Loading...