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 

Polytopes limited to 32 planes


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


Joined: 06 Dec 2013
Posts: 70

PostPosted: Wed Sep 20, 2017 4:15 pm    Post subject:
Polytopes limited to 32 planes
Reply with quote

Hi all,

There seems to be a maximum of 32 osg::Plane that can be added to a osg::Polytope for intersection computations. The osg::Plane beyond 32 are not checked against.

Is there a reason for this?

Thanks,

Antoine
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12144

PostPosted: Thu Sep 21, 2017 8:28 am    Post subject:
Polytopes limited to 32 planes
Reply with quote

Hi Antoine,

On 20 September 2017 at 17:15, Antoine Rennuit < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi all,

There seems to be a maximum of 32 osg::Plane that can be added to a osg::Polytope for intersection computations. The osg::Plane beyond 32 are not checked against.

Is there a reason for this?


I don't recall the details, but most likely down to a uint being used as mask internally.


I'd be cautious about expanding it beyond this, checking more than 32 planes is going to be pretty expensive, if you are getting to this level of planes then I would expect that solving the task with a different appropriate would probably be appropriate.  A custom technique may be the most appropriate route.



Robert.

 

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


Joined: 06 Dec 2013
Posts: 70

PostPosted: Thu Sep 21, 2017 5:55 pm    Post subject:
Reply with quote

Hello Robert, and thanks for your clear answer.

Now for the suggestion to use a custom technique, are you thinking about using GL_SELCT with glRenderMode() and the glInitNames() / glPushName() functions? If so, do you know any example code implementing this?

Kind regards,

Antoine.
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12144

PostPosted: Fri Sep 22, 2017 7:48 am    Post subject:
Polytopes limited to 32 planes
Reply with quote

Hi Antoine,

On 21 September 2017 at 18:55, Antoine Rennuit < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Now for the suggestion to use a custom technique, are you thinking about using GL_SELCT with glRenderMode() and the glInitNames() / glPushName() functions? If so, do you know any example code implementing this?


Using GL to do picking is possible but I generally wouldn't recommend it as it requires a round trip to the graphics hardware so you have a large overhead associated with the operation.


When I'm thinking of a custom approach I'm thinking of a user implementing something like a intersection scheme that uses a hierarchy of osg::Plane to break the volume into half spaces.  So you end up with a graph of osg::Plane rather than a single osg::Plane list like you have in a osg::Polytope.    Another approach would be to create a graph of Polytope to break up your volume.



FYI, osg::Polytope was originally written for view frustum culling and has been expanded to be used elsewhere, in your case you it sounds like you are pushing a bit beyond the tradeoff in design it's adopted - it's built around performing view frustum culling as quick as possible.



Robert.

 

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


Joined: 06 Dec 2013
Posts: 70

PostPosted: Mon Sep 25, 2017 10:05 am    Post subject:
Reply with quote

Hello Robert,

I totally get your point when you say I stretch osg::Polytope a bit too far, this is also the feeling that I had...

As for using a custom hierarchy of osg::Plane, I understand that you are talking about a layered approach for intersections. Having the scene first intersect with a rough polygon (e.g. the bounding box of the initial polygon) and then refining the polygon. Even a 2 steps approach should drastically speed-up the intersections test. That's a really good idea, thanks!

Regards,

Antoine.
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 Clipping planes and osgVolume Alex Taylor General 1 Thu Apr 07, 2016 2:25 pm View latest post
No new posts Culling with custom clip planes scrawl General 7 Wed Apr 08, 2015 7:58 pm View latest post
No new posts osg 2.2.0 to 2.8.5 => Clipping pla... antoinec General 2 Wed Jul 31, 2013 6:37 pm View latest post
No new posts osg 2.2.0 to 2.8.5 => Clipping pla... antoinec General 0 Mon May 13, 2013 7:22 am View latest post
No new posts problems with clip node and clip planes wernerM General 0 Fri May 10, 2013 12:15 pm 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