OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Can see parts of the back side of a model


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
bclay
Newbie


Joined: 28 Oct 2015
Posts: 12

PostPosted: Thu Aug 24, 2017 12:09 am    Post subject:
Can see parts of the back side of a model
Reply with quote

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
Back to top
View user's profile Send private message
tianzjyh
Guest





PostPosted: Thu Aug 24, 2017 1:05 am    Post subject:
Can see parts of the back side of a model
Reply with quote

Hi, Clay,
Could you please attach a picture relative to the problem. Also, could you please describe what is the model's behavior under normal OSG, saying it viewed by "osgviewer.exe".


--


Cheers,
---
TianZJ




Quote:
At 2017-08-24 08:09:23, "Bruce Clay" <> wrote:
Quote:
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.>Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71514#71514



------------------
Post generated by Mail2Forum
Back to top
Voerman, L.
Guest





PostPosted: Thu Aug 24, 2017 7:17 am    Post subject:
Can see parts of the back side of a model
Reply with quote

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:ShockedN);

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12094

PostPosted: Thu Aug 24, 2017 7:54 am    Post subject:
Can see parts of the back side of a model
Reply with quote

HI Bruce,

On 24 August 2017 at 01:09, Bruce Clay < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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.

 
 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
bclay
Newbie


Joined: 28 Oct 2015
Posts: 12

PostPosted: Thu Aug 24, 2017 2:43 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12094

PostPosted: Thu Aug 24, 2017 3:02 pm    Post subject:
Can see parts of the back side of a model
Reply with quote

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
bclay
Newbie


Joined: 28 Oct 2015
Posts: 12

PostPosted: Fri Aug 25, 2017 8:00 pm    Post subject:
Reply with quote

Robert:

Thanks for your help. I could not get the camera instance but was able to create the camera as in the original code and add the setGlobalDefaults as you suggested.

Things are appear to be working correctly now.

Thanks again

Cheers,
Bruce
Back to top
View user's profile Send private message
Meldryt
User


Joined: 02 Mar 2016
Posts: 60

PostPosted: Fri Mar 02, 2018 3:44 pm    Post subject:
Reply with quote

Hi, i have a similar problem and dont want to create a new thread.

Unfortunately i couldnt fix the problem with these solutions here.

What you can see is the back of a plane with enabled front (transparency) or back (black/no lightning) face culling.[/img]

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12094

PostPosted: Fri Mar 02, 2018 4:45 pm    Post subject:
Can see parts of the back side of a model
Reply with quote

Hi Sebastian,

On 2 March 2018 at 15:44, Sebastian Schmidt <> wrote:
Quote:
Hi, i have a similar problem and dont want to create a new thread.

Unfortunately i couldnt fix the problem with these solutions here.

It's a different problem then, so worthy of it's own thread. It'll be
a different problem with a different solution. Could you start a
fresh thread and if possible give a bit more background the model, and
how you are rendering it.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Meldryt
User


Joined: 02 Mar 2016
Posts: 60

PostPosted: Thu Mar 15, 2018 3:47 pm    Post subject:
Reply with quote

In my case the original 3DS model had some flipped face normals due to wrong vertex winding etc.

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Model matrix kullboys General 0 Tue Aug 21, 2018 7:10 am View latest post
No new posts missing color for simple model with G... aroth General 1 Fri Jul 27, 2018 1:55 pm View latest post
No new posts Model(s) load ~10 times longer in 3.6... davisjamesf General 16 Wed Jul 04, 2018 7:18 pm View latest post
No new posts Model flickering on osgViewer ceranco General 3 Thu Jun 21, 2018 10:02 am View latest post
No new posts Export the cropped model Wangbingqian General 2 Thu Jun 07, 2018 8:42 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP