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 

Objects sub-selections


 
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: 45

PostPosted: Mon Sep 04, 2017 10:16 am    Post subject:
Objects sub-selections
Reply with quote

Hi OSG forum,

In the application I am developing I need to implement sub-selection, that is picking of the elements that compose a drawable. e.g. for a mesh, that would be selecting / picking the vertices or triangles that compose the mesh. For instance, this makes it able to edit the mesh by updating its vertices position.

Is this possible to achieve with OSG?

What I have seen so far in OSG (i.e. LineSegmentIntersector and PolytopeIntersector) only returns the drawable, and it does not seem possible to return the vertices or triangles composing the drawable.

Kind regards,

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


Joined: 18 Mar 2009
Posts: 11238

PostPosted: Mon Sep 04, 2017 11:06 am    Post subject:
Objects sub-selections
Reply with quote

Hi Antoine,


Have a look at the include/osgUtil/LineSegmentIntersector and PolytopeIntersectors, specifically the Intersection data structures they have all you are looking for Smile


Robert.


On 4 September 2017 at 11:16, Antoine Rennuit < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi OSG forum,

In the application I am developing I need to implement sub-selection, that is picking of the elements that compose a drawable. e.g. for a mesh, that would be selecting / picking the vertices or triangles that compose the mesh. For instance, this makes it able to edit the mesh by updating its vertices position.

Is this possible to achieve with OSG?

What I have seen so far in OSG (i.e. LineSegmentIntersector and PolytopeIntersector) only returns the drawable, and it does not seem possible to return the vertices or triangles  composing the drawable.

Kind regards,

Antoine.

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





_______________________________________________
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
arennuit
User


Joined: 06 Dec 2013
Posts: 45

PostPosted: Mon Sep 04, 2017 4:45 pm    Post subject:
Reply with quote

Robert,

Thanks for your quick answer, I have tested and your hint led me somewhere.

Now I understand that the PolytopeIntersector::Intersection::primitiveIndex is the index of the sub-object in the osg::Vec3Array defining the drawable, is that right?

Also, I have the feeling that the primitives returned can only be of a single type (vertices, lines or triangles/quads) and that this type depends on the mode of the PrimitiveSet associated to the drawable, is that right? And that means if I want to select vertices, I need to draw osg::PrimitiveSet::POINTS, is that correct?

Kind 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 Shadows on "invisible" objects Trajce Nikolov NICK General 2 Tue Mar 28, 2017 7:09 am View latest post
No new posts How to group many objects so that the... BoraDrljaca General 0 Mon Aug 22, 2016 3:38 am View latest post
No new posts osg shadow minimal shadow map and aut... Andreas Goebel General 1 Fri Jul 08, 2016 3:34 pm View latest post
No new posts Could not find plugin to read objects... robertosfield Plugins [osgPlugins] 2 Sat Jul 02, 2016 1:45 pm View latest post
No new posts working with transparent objects Trajce Nikolov NICK General 2 Wed Apr 06, 2016 8:41 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