[osg-users] Adding billboards with different names under the same geometry?

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Wed May 20 15:28:16 PDT 2020


Hi,

I'm displaying icons over the terrain as billboards (always facing the 
user). These icons represent structures and landmarks (hydroelectric dams, 
national parks, mountain peaks, mining projects...), so I'll load some tens 
of thousands of them, and show some hundred or a few thousand at a time. To 
save memory, I've learned that I must use a single geometry per class of 
icon. So, for hydroelectric dams (hidrelétricas, in Portuguese), I'm doing 
once:

            geodeHidreletrica = new osg::Billboard;
            geodeHidreletrica->setMode( osg::Billboard::POINT_ROT_EYE );
            osg::Geometry* quadHidreletrica = 
createQuad("icons/hidreletrica.png","QuadHidrelétrica");

and for each icon I do:

            geodeHidreletrica->addDrawable( quadHidreletrica, osg::Vec3( 
lon, lat, alt ) );

So far so good, the icons appear where they should. "QuadHidrelétrica" is 
the name of the quad (using setName). However, I want to have a different 
name for each icon, or somehow identify them by name when the mouse is over 
them. Is that possible using this strategy? Or should I do things 
differently? If so, what's the best approach, regarding performance?

Thanks,
Rodrigo.

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/9d374000-2dc0-4fad-b6a3-3035246e2143%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200520/6b66d5fe/attachment.html>


More information about the osg-users mailing list