[osg-users] Can see parts of the back side of a model

Voerman, L. l.voerman at rug.nl
Thu Aug 24 00:16:03 PDT 2017


Hi Bruce,
backface culling does not work with surface normals, the front and back
faces are separated by the vertex winding.
your model might have the faces in the wrong direction - or QT might have
left openGL in an unexpected state.
maybe this could help:
                osg::ref_ptr<osg::CullFace> cf = new osg::CullFace;
                cf->setMode(osg::CullFace::FRONT);
                ss->setAttributeAndModes(cf.get(),
osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
or possibly this:
    ff = new osg::FrontFace;
    ff->setMode( inverted() ? osg::FrontFace::CLOCKWISE :
osg::FrontFace::COUNTER_CLOCKWISE);
    ss->setAttribute(ff);

Regards, Laurens.


On Thu, Aug 24, 2017 at 2:09 AM, Bruce Clay <bclay1297 at gmail.com> wrote:

> Hi,
>
> I am using OSG 3.4 with QT 5.8 and Visual Studio 2015.  I am also using
> the QT osgWidget class I found on line.  When I load a model I can see
> parts of the inside or back side of the model.  One viewer noted that it
> looked like the surface normals are inverted.  I could not find anything in
> the osgWidget class or anything in the qtOsgWidget class that has anyeffect
> on surface normals.
>
> Any suggestion would be greatly appreciated
>
> Thank you!
>
> Cheers,
> Bruce
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71514#71514
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170824/1ed14a72/attachment.htm>


More information about the osg-users mailing list