[osg-users] camera attached to a node

Philip Hahn everphilski at gmail.com
Fri Oct 12 18:34:09 PDT 2007


Santosh-

Yes, I did. But I'm sure I made a mistake somewhere :) After instantiating
the node tracker manipulator, I bind it to a node, set the minimum distance,
tracker mode and rotation mode like so:

    nodeTracker->setTrackNode( rootNode->getChild(1)->asGroup()->getChild(0)
);
    nodeTracker->setMinimumDistance(10.0);
    nodeTracker->setTrackerMode(
osgGA::NodeTrackerManipulator::TrackerMode::NODE_CENTER );
    nodeTracker->setRotationMode(
osgGA::NodeTrackerManipulator::RotationMode::TRACKBALL );

and then

    nodeTracker->getMatrix()

to get the matrix for my camera. It seems to follow the flight path of my
node, however I can't see the node. I haven't tried adding keyboard or mouse
controls yet. But by default, how should the tracker respond? trailing the
node as it maneuvers, correct? and then targeting the node for
visualization? or not?

 Thanks,

Philip





On 10/12/07, santosh <santosh at darshan3d.com> wrote:
>
> Hi Philip
> Did you tried osgGA::NodeTrackerManipulator. In this Manipulator you can
> attach a  Node  to which this manipulator follows and also by keeping
> key press  of that manipulators key bind you can rotate camera about
> that node .
>
> ---------
> Santosh
> +91 9999785853
>
>
>
>
>
>
> Philip Hahn wrote:
>
> > good afternoon-
> >
> >  I was looking at the NPS tutorials and it was mentioned in tutorial
> > 11.1 that a osgGA::TrackerManipulator can be used to attach a camera
> > to a node.
> >
> >  I tried this, (by attaching the TrackerManipulator to the node in
> > question, then manually setting my view matrix using the
> > TrackerManipulator's getMatrix() ) and while the camera follows the
> > path of my node through space as it moves (it is scripted), I don't
> > see my node. I did set a minimum following distance.
> >
> >  Could someone either point me to a tutorial or give me a quick
> > overview of how to a TrackerManipulator? Ultimately I'm trying to make
> > a camera I can orbit around a moving vehicle, keeping focus on the
> > vehicle (I presume some if not all of this functionality exists, I'm
> > just not seeing it ... ) . Right now I'm manually calculating it using
> > spherical coordinates, retrieving the position of my target node, and
> > using makeLookAt() to generate a matrix.
> >
> >  Thanks,
> >
> > Philip
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >osg-users mailing list
> >osg-users at lists.openscenegraph.org
> >http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071012/7c99da70/attachment-0003.htm>


More information about the osg-users mailing list