On Tue, Oct 5, 2010 at 3:12 PM, Robert Osfield <[email protected]>wrote:
> Hi Paul, > > On Tue, Oct 5, 2010 at 1:25 PM, paul graham <[email protected]> wrote: > > Hi, I'm hoping someone can help - I'm calculating a scaling value in my > cull traversal using the pixelSize() function. I then set my scaling matrix > in the update traversal. > > > > The problem with this is that the scale calculated is always one frame > out when it get's applied - so there's a noticeable jerkiness on zooming > in. > > > > If I update my matrix in the cull traversal, zooming is smooth, however I > understand that this is a dangerous thing to do. > > In general I would recommend users modify the scene graph outwith the > cull and draw traversals as this ensures the most flexible and > robustness w.r.t any threading and multi-context work that you may > wish to do. > > However, as long as your aware of the potential pitfalls it can be > safe to modify the scene graph during cull, and it's also possible to > compute data on the fly dynamically in cull and avoid any need to > modify the scene graph. > > In your cull traversal you can push a matrix on the ModelView stack, traverse the subgraph, and then pop the matrix without modifying the scene graph at all. Take a look at osgUtil::CullVisitor::apply(Transform&) to see how this is done. You do need to be careful that the bounding volume of the node is set so that the node will be culled properly. Tim
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

