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

2017-08-24 Thread Voerman, L.
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 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  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@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2017-08-24 Thread Robert Osfield
HI Bruce,

On 24 August 2017 at 01:09, Bruce Clay  wrote:

> 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.
>
>
When references a 3rd party code that is online somewhere it would be worth
providing a link to it.

FYI, osgWidget is a NodeKit in OSG-3.4 so references a class of the same
name is a bit confusing.  I presume you aren't talking about the osgWidget
NodeKit as it has nothing to do with Qt.

As the issue, is this a new issue?  Could it be lack of depth testing?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Mesh Outline

2017-08-24 Thread Nabil KHALIFA
Hi,
Problem solved by using PolygonOffset

On 22 August 2017 at 18:08, Nabil KHALIFA  wrote:

> Hi,
> ​I use OSG to draw the silhouette outline of a mesh.
> The result is fine. But when i superpose the silhouette and the mesh, the
> inner border of the box are hidden (the lines in red).
> Is there any way to draw them over?
> Thx
>



-- 
Nabil Khalifa
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Custom data within nodes or drawables

2017-08-24 Thread Antoine Rennuit
Dear OSG forum,

I am currently implementing picking and selection inside my app. I have setup 
everything up to the point where I can know the osgUtil::Intersection and with 
it the Drawable that was picked.

Now, what I am really interested in is not the Drawable or Node itself but the 
object it represents in my DataBase. Hence I would like to associate my OSG 
rendered objects with my DataBase objects. To that intent, is there something 
like a custom data in the Drawables in which I could store a pointer to my 
DataBase objects? Or should I handle this association and lookup myself?

Thank you!

Antoine

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71520#71520





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Custom data within nodes or drawables

2017-08-24 Thread Robert Osfield
HI Antoine,

The osg::Object base class a coarse grained
Object::setUserData(Referenced*) feature, or a fine grained template based
Object::setUserValue(strd::string& name, T value); method.  The later
functionality is managed via UserData using a UserDataContainer class that
agregates use the UserValue's in the form of template UserObjects.

Drawable subclasses from Object so you can get all the functionality you
want for there.

Robert.

On 24 August 2017 at 10:52, Antoine Rennuit 
wrote:

> Dear OSG forum,
>
> I am currently implementing picking and selection inside my app. I have
> setup everything up to the point where I can know the osgUtil::Intersection
> and with it the Drawable that was picked.
>
> Now, what I am really interested in is not the Drawable or Node itself but
> the object it represents in my DataBase. Hence I would like to associate my
> OSG rendered objects with my DataBase objects. To that intent, is there
> something like a custom data in the Drawables in which I could store a
> pointer to my DataBase objects? Or should I handle this association and
> lookup myself?
>
> Thank you!
>
> Antoine
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71520#71520
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Custom data within nodes or drawables

2017-08-24 Thread Antoine Rennuit
That's awesome!

Thanks a lot Robert,

Antoine.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71522#71522





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2017-08-24 Thread Bruce Clay
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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2017-08-24 Thread Robert Osfield
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
osg::Camera

 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
127

Robert.


On 24 August 2017 at 15:43, Bruce Clay  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@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OpenSceneGraph-3.4.1-rc3 tagged

2017-08-24 Thread Robert Osfield
Hi All,

I have just tagged the 3.4.1 release candidate 3:


https://github.com/openscenegraph/OpenSceneGraph/tree/OpenSceneGraph-3.4.1-rc3

I have only made a couple of minor changes since rc2, so it feels like we
are converging nicely to a stable release.  If feedback is positive I'll
tag 3.4.1 tomorrow!

I would greatly appreciate testing of 3.4.1-rc3  across as many
platform/build combinations as you can.

Thanks in advance,
Robert.

-- Changes since rc2, details below:

$ git log
commit c1055fdfbceb297a4f2108811c0ec1148da30826
Author: Robert Osfield 
Date:   Thu Aug 24 17:49:34 2017 +0100

Updated rc number to 3 or 3.4.1-rc3

commit 328632af7511e02ad128e57399479f7bc2b1eec0
Author: Robert Osfield 
Date:   Thu Aug 24 17:45:48 2017 +0100

Updated READE and ChangeLog

commit ec89d96114045dbc3a2df479fd9457b6b038ccaa
Author: Robert Osfield 
Date:   Wed Aug 23 15:26:07 2017 +0100

Fixed underflow issue

commit ea17943a7497cf774d22e937453c61189855a61d
Author: Robert Osfield 
Date:   Tue Aug 22 14:17:45 2017 +0100

Bimped SO version due to changes in Windows exports in osgDB::ifstream
+ ofstream.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org