Re: [osg-users] Coordinate system mapping from WTK to OSG...

2008-08-11 Thread neil.hughes
Hi Jason,

thanks for the comments. I think I've got to the bottom of it now. There is 
some rather irritating issues associated with which rotation is performed 
first. Finally got an ordering (trial-and-error) that did what it was supposed 
to do. Coupled with the rotation about X I feel significantly older now ;-(

Once again, thanks for the comments.

Regards

Neil.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Coordinate system mapping from WTK to OSG...

2008-08-08 Thread Jason Daly

[EMAIL PROTECTED] wrote:

So, if anyone out there has experience of mapping from WTK to OSG, specifically 
in regards to what should happen to rotation angles, and quarternians, I would 
be most grateful - and perhaps my wall could then be repainted beige instead of 
red ;-(
  


I don't know about OSG to WTK specifically, but I might have a suggestion.

When translating an orientation (or more specifically,  a rotation) from 
one coordinate system to another, the correct procedure is to first 
convert from your target coordinate system to your original coordinate 
system, then apply the rotation, then convert back.  So


 -1
R' = M * R * M


Where R' is the desired rotation in OSG coordinates, R is the rotation 
in WTK coordinates, and M is the conversion matrix (or quat) from WTK 
coordinates to OSG coordinates.


Now, usually when I explain this, I get the ordering wrong, so if it 
doesn't work first try, just try reversing the order  :-)


Hope this helps!

--J

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org