How can lat/lon/alt get converted to sgMat4 coordinates? I thought
the following portion of code, taken from test-up.cxx, would
be close (at least for position, but not for the rotation).
double lat = 38.9340;
double lon = -77.4576;
double alt = 0;
Point3D pgd( lon * SGD_DEGREES_TO_RADIANS, lat * SGD_DEGREES_TO_RADIANS, alt );
Point3D pc = sgGeodToCart( pgd );
sgMat4 xxMat4;
sgMakeCoordMat4 ( xxMat4, (float) pc.x(), (float) pc.y(), (float) pc.z(),
0.0f, 0.0f, 0.0f );
// just for debug/confirmation
sgCoord xxloc;
sgSetCoord ( &xxloc, xxMat4 );
However, at this point, the numbers in the xxloc structure don't match
those of known conversions. Am I missing some translation/rotation
call?
Thanks for any help.
Wendell
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel