Re: [osg-users] Picking primitive subset
Hi, I'm new to OpenSceneGraph and working on a similar problem. I'm trying to write an application that allows the user to select different faces of a geometry that I load via Collada and than save the Geometry as a Collada file again that contains the selected Geometry as well as the original one. So basically I try to write some kind of select-tool to specify some regions directly on the geometry. Of course it would also be helpfull to highlight them. I'm already able to pick a certain polygon find the associated geometry and the primitiveIndex of the picked Polygon, but I cannot find the associated vertices and normals to highlight the faces by generating some additional geometry that lies on top of the original one. Have you (or anyone else) found any solution or example for this problem in the meantime? Thank you! Cheers, Florian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16747#16747 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Picking primitive subset
Hi, I have a geometry that is represented by perhaps 500K triangle and/or quad primitives. During user interaction, I need to pick ( using a selection rectangle) a significant subset ( say 10K) of these primitives and highlight them ( simply turning the picked primitives wireframe would do). Any suggestions on how to do this efficiently? I have OSG picking working great with osg::Node objects but am a bit unsure of how to pick a subset of primitive QUADS/TRIS from a single geometry. Thank you! Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13297#13297 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking primitive subset
Hi Paul, I suppose I am unsure of OSG best practices to use when picking of primitives. With osg::Nodes I am using userdata quite effectively to relate an picked osg::node back to my data model - but with primitives it is not quite so clear what the best OSG way would be especially when dealing with 500K primitives. My naive approach would be to store a lookup relating primitive index to my C++ model object so I can extract my C++ object from a primitive pick index. Also , I am not sure how best to go about showing the selection. I could, for example, break the geometry into selected and non-selected geonodes and shuffle the primitives back and forth between these two based on what has been selected or de-selected. ... Thank you! Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13308#13308 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking primitive subset
Also , I am not sure how best to go about showing the selection. I could, for example, break the geometry into selected and non- selected geonodes and shuffle the primitives back and forth between these two based on what has been selected or de-selected. It sounds like you're saying you would copy the picked data into another Geometry. There is really no need for that. Just have two Geometries (one for the normal data display, and one for pick highlighting with a decorator or StateSet mod of your choosing), and make the two Geometry objects share the same vertex array. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking primitive subset
Paul, I already have the two geometries sharing the same vertex array. But some decorations to show a picked state are mutually exclusive. For example, showing the picked primitives subset as wireframe ( not filled) is not possible as the same primitives will be present as filled in the default set. I suppose the sensible thing is to pick a decoration that can overlay the existing geometry (e.g all picked elements are outlined in a thick line) or are a different color with a larger polygon offset. Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13316#13316 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking primitive subset
One thing that makes the primitiveIndex field of the intersection classes significantly less useful that it could be is that the Intersector decomposes QUADS etc into triangles. This means some additional housekeeping to keep track of what the index relates to -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13319#13319 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org