Discussion:
[osg-users] osg::Drawable vs osg::Geometry
NoÚ Murr
2018-10-21 14:45:11 UTC
Permalink
Hi,

I need to draw a custom object in osg.

To do that I have to choose between derive from class osg::Drawable and deriving from osg::Geometry.

Which is the more efficient way to create a custom drawable object and why?

Thank you!

p.s. I'm new to osg, so I'm trying to understand the best practices.

Cheers,
Noè

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75105#75105
Chris Hanson
2018-10-21 18:26:40 UTC
Permalink
Suggesting the best approach would require you give us a little more detail
about what kind of custom object it is. Can you describe better what you're
trying to do, and less about how you are trying to do it?
Post by NoÚ Murr
Hi,
I need to draw a custom object in osg.
To do that I have to choose between derive from class osg::Drawable and
deriving from osg::Geometry.
Which is the more efficient way to create a custom drawable object and why?
Thank you!
p.s. I'm new to osg, so I'm trying to understand the best practices.
Cheers,
NoÚ
------------------
http://forum.openscenegraph.org/viewtopic.php?p=75105#75105
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. ***@AlphaPixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
Julien Valentin
2018-10-21 20:11:23 UTC
Permalink
Hi
If you can fit in osg::Geometry semantic your data and just want to override drawimplementation, guidelines prescribe to setup a DrawCallback.
using osg::Geometry have also the advantage for your data to be interpreted for various task in osg (computebound,primitivefunctors, osgutil visitors..)
If you really need to subclass, prefer Drawable over Geometry if you don't want osg can interpret your Drawable as a Geometry (which is sometime the case..)

Cheers
Post by NoÚ Murr
Hi,
I need to draw a custom object in osg.
To do that I have to choose between derive from class osg::Drawable and deriving from osg::Geometry.
Which is the more efficient way to create a custom drawable object and why?
Thank you!
p.s. I'm new to osg, so I'm trying to understand the best practices.
Cheers,
Noè
------------------------
Twirling twirling twirling toward freedom

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

Loading...