Hi, Mel,


Mel Av wrote:
1. You have to inverse the tr*rot result first

This probably comes from the fact that you're setting a View matrix, which is essentially the inverse of a model matrix. The transform in the OSG scene forms the Model matrix, which is combined with the view matrix in the camera to get the overall modelview matrix passed to OpenGL.

If you're already getting accurate position tracking, though, I don't think you'll get correct behavior if you invert the result.


2. After you do that, you have to rotate -90 degrees about the x-axis because 
Matrix classes use a Y-up coordinate frame whereas the viewer uses a Z-up 
coordinate frame.

There's no inherent coordinate frame in the Matrix classes, or in OpenGL, or OSG. The coordinate frame depends primarily on the scene that you create. Typically, OSG scenes are Z-up, but this isn't necessarily true.

If you do need to convert a rotation between coordinate systems, the correct way to do this is M * R * Minv, where M is the matrix needed to rotate one coordinate system to the other, Minv is the inverse of that matrix, and R is the rotation that needs conversion.

Will these two corrections solve the problem?

I don't think so, simply because you're already getting correct behavior from your position tracking. It's only the orientation tracking where you're having issues.

Oftentimes, tracking systems use one coordinate system for the overall tracking space, and a different one to report the orientation. Are you sure you've got the correct coordinate system for the tracked object? From what you said above, it sounds to me like your tracked object might be Z-down (even though the overall tracking space is Z-up).


Will I also need to do something more advanced like dynamically changing the 
frustum according to the head position?

No, you shouldn't need anything like that.

--"J"
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to