Hi Oran,

What you are trying to do is all possible with the OSG without too
much work, but will require a little learning.

I would recommend using a separate osg::Geometry for each user
selectable object, as this will just make things easier to manage when
it comes to highlighting the objects, changing colours etc.

There are various ways to highlight objects, the most straight forward
is probably just to decorate with an osgFX::Scribe. For an example
that illustrates picking, highlight and cutting objects from the scene
have a look at the OpenSceneGraph/examples/osgkeyboardmouse example.

W.r.t VBO's this can be done by setting the
drawable->setUseVertexBufferObjects(true);   However, for 500,000 it
won't be too critical as most modern hardware will be able to cope.

Robert.


On 30 May 2015 at 04:13, Oran Wallace <[email protected]> wrote:
> Hi all,
>
> First off I want to say I'm new to OSG but I have worked with openGL.
>
> I'm writing an application that uses OSG + Qt and I'm currently designing the 
> geometry class. I read in a file which contains information on the geometry. 
> The geometry is simple; points form faces, faces form rooms and rooms form 
> the whole model.
>
> I want the user to be able to select arbitrary objects (probably just faces 
> to start with), when selected the object will be highlighted. They will be 
> able to change the color, but not edit the geometry. Additionally I will need 
> to add/remove objects to the graph from user input, such a spheres, point and 
> lines. Faces can have >=3 points.
>
> I want it do perform well for large models (500k+ points) and try to take 
> advantage of VBOs.
>
> Now for my questions:
>
> Is this even possible with a single (or multiple perhaps one for triangles, 
> quads, etc.) VBO given my criteria? Should I just use a osg::Geometry object 
> for each face or each room (this would be the easiest I think)?
>
> I'm currently attempting to form triangles for everything and use a single 
> primitiveSet and vertex pool. Is this advisable? Seems I can use a utility 
> like the DelaunayConstraint or Tesselator to break down each face into 
> triangles. Should I create a mapping between the new triangles and faces to 
> make use of LineSegmentIntersector (which seems to be the only way for 
> picking, unless I'm missing something).
>
> If anyone has advice or experience in something similar I would be very 
> grateful.
>
> Thank you!
>
> Cheers,
> Oran
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=63890#63890
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to