[osg-users] viewport is changing after huge sized object ; updating only visible nodes

Robert Osfield robert.osfield at gmail.com
Wed Mar 30 00:19:31 PDT 2016

On 30 March 2016 at 08:14, Andrey Perper <TheAndreyp at gmail.com> wrote:

> >I guess he wants to have the updateCallback called for "culled" geodes,
> or some way to check if the node was culled.
> Yes!! that is correct!

The OSG by default calls update callbacks on all nodes that have an update
callback, so works fine for culled and non culled nodes/drawables/statesets.

If you want to just do updates on objects that aren't culled and in the
view frustum then you'll be best using a cull callback, but would need to
take care if your application is multi-threaded as multiple threads could
end up reading/writing to the shared data structures.

> > I know too little about the specifics of your application.
> The Application has earth + missile tracks on earth.
> I just add these tracks to scene and my viewer must stay at point before
> adding. Camera rotating is performed around earth center

There is the osgGA::NodeTrackerManipulator, see the osgsimulation example -
it tracks an oversized cessna model as it tracks around the eath.

I suspect this camera manipualator isn't exactly what you'll need so will
need to consider writing your own camera manipulator to simple computing
the view matrix in the main loop and applying this to the viewer's master
Camera's view matrix each frame. If you do the later then there isn't any
need for camera manipulator.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160330/f1e8d380/attachment-0003.htm>

More information about the osg-users mailing list