[osg-users] How to rotate node's local coordinate system?

Robert Osfield robert.osfield at gmail.com
Tue Jun 23 02:09:33 PDT 2015


Hi Elias,

It seems to me that you are confusing local, world and eye coordinate
frames.

I really don't know why you are discussing NodeTrackerManipualtor in this
context, it's a camera manupulator for setting the view matrix of the
viewer's Camera to follow a Node in the scene graph.  The manipulator is
setting eye coordinates.  The object it tracks has a path from the root of
the scene graph to the node, the transforms between the root and the node
you specify provides the coordinate frame relative to world coordinates,
where world coordinates it the coordinate frame of the root node.   The
manipulator doesn't have any effect on the coordinate frame of the node
being tracked, just affects viewer's Camera's view matrix.

If you want to change a node local coordinate frame then you use a
transform.

Robert.




On 23 June 2015 at 09:56, Elias Tarasov <elias.tarasov at gmail.com> wrote:

> Hello, Robert!
> Thanks for the quick reply.
> It seems i wasn't able to clarify my question. I dont use MatrixTransform
> or PositionAttitudeTransform here because i don't want to transform my
> target node relate to others. I want to change local XYZ in that node
> itself, not the position of my node relate to other nodes or world XYZ.
>
> Let me describe more specifically.
> Standart aerodynamic convention (and it also looks reasonable in most
> practical situations) defines local(body) coordinate system as:
> O - center of mass (here just center of a node), X - from center up to
> nose, Y - from center up to right wing, Z - down. That leads to Roll,
> Pitch, Yaw rotations around X,Y,Z respectively.
>
> Let say i want to place camera right behind cessna's tail. Then, AFAIK
> that code can help me
>
> Code:
>
> nodeTracker = new osgGA::NodeTrackerManipulator;
> nodeTracker->setHomePosition( Vec3(-90,0,0), Vec3(), Z_AXIS );
> nodeTracker->setTrackerMode(osgGA::NodeTrackerManipulator::NODE_CENTER_AND_ROTATION
> );
> nodeTracker->setTrackNode( cessna.get() );
>
>
>
>
> So: eye Vec3(-90,0,0) means 90 behind center on X. //Local coords, right?
> And of course what we can see now is depended on how X is oriented with
> respect to model body.
>
> If, for instance, X has center at model's center and go straight up to
> nose,
> then -90 means right behind tail (this is what i want to achieve)
>
> But if X has center at model's center and go from right wing, then -90
> means we see left side of an aeroplane, not the tail.
>
> Then, even when cessna moves correctly (for instance, straight to the
> north), i see at as moving with right wing forward and nose to the west.
>
> Also, Roll (rotation about X axis) will be looking like pitch (rotation
> about Y axis according to aerodynamic standart)
> So to avoid confusion and necessity to remeber how that particular node
> (cessna) is oriented with respect to its own local coords, maybe the better
> way is to rotate local coords somehow?
>
> I might be wrong, just to explain why i cannot use Tranform classes
> according to you advice.
>
> Could you explain how that problem might be solved?
>
> Thank you!
>
> Cheers,
> Elias
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64161#64161
>
>
>
>
>
> _______________________________________________
> 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/20150623/ac05f63b/attachment-0003.htm>


More information about the osg-users mailing list