Hi John, On Thu, Apr 1, 2010 at 1:16 AM, John Galt <[email protected]> wrote: > I want to have the viewTwo camera follow the pyramidTwoXForm (PAT). How do I > set it to do the required? > > Please help me, I am unable to figure this out for a while now.
"Following" a node is a bit open ended, so how to do it is a bit open ended as well. As we can't know exactly what you mean by "follow" as node we'll just take a few guess. First up would the osgGA::NodeTrackerManipulator work for you? Have a look at the osgsimulation example for an example of it in action. Second approach would be to manually set the second view's master camera's view matrix on each new frame yourself, either via a update callback attached to the camera, or a setting directly in the viewer main frame loop - just set the camera before the viewer.renderingTraversals() call. If you can this approach you next question will be how to compute the view matrix, for this is where the open ended bit comes in - only you know how you want it to follow. You will of course need to know the position of the node in question, and you can use node->getWorldMatrices() to work out where it is, then use this is whatever way you want to get the view matrix you need. This is vector maths that I'll have to presume you are comfortable with. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

