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

Robert Osfield robert.osfield at gmail.com
Thu Aug 24 08:00:52 PDT 2017

Hi Bruce,

A quick look at the OSGWidget.cpp and it looks to me like the code is
creating its own osg::Camera and assigning it to the view but this Camera
never sets up global default state so OpenGL defaults will be used, depth
testing is off by default in OpenGL, which in turn will give this problem.
This is a bug in OSGWidget.cpp that needs fixing and passing on to the
authors of the code.

What the code should do is either:

 1)  Use the View's master Camera rather than replacing it with a locally
created one, View's master Camera has a StateSet with the appropriate
   global defaults applied.  i.e.

   osg::Camera* camera = view->getCamera() // replacing camera = new

 2) Assign a StateSet to the Camera, and set it's up with the appropriate
global defaults for the 3D scene i.e.

    camera->getOrCreateStateSet()->setGlobalDefaults();  // add around line


On 24 August 2017 at 15:43, Bruce Clay <bclay1297 at gmail.com> wrote:

> Hi,
> The original source code related to this problem was downloaded from
> https://github.com/Submanifold/QtOSG.
> The QtOSG class is similar in function to the osgQt distributed with OSG
> in function but it seems more "native" to OSG itself.  That is I could see
> all of the normal OSG code.  When I use the osgQt class I can display the
> model properly but I don't appear to get the same window capabilities.
> The good and bad images were attached as requested
> Thank you!
> Cheers,
> Bruce
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71523#71523
> _______________________________________________
> 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/af59f99e/attachment.htm>

More information about the osg-users mailing list