Advertisement

coordinate system conversion

Started by May 18, 2012 06:30 PM
0 comments, last by irreversible 12 years, 9 months ago
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]hi. my first post.... hope someone can help.[/background]

[/font]
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]i am trying to build my own simulator and i am using some of flightgears methods and concepts.[/background]

[/font]
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]i have trouble understanding something.[/background]

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]flight gear uses cartesian coordinate system (The X axis runs along a line from the center of the earth out to the equator at the zero meridian. The Z axis runs along a line between the north and south poles with north being positive. The Y axis is parallel to a line running through the center of the earth out through the equator somewhere in the Indian Ocean). origin is the center of the earth.[/background]

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]now, in my program i want my origin to be my camera position (0,0,0).[/background]

[/font]
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]how to convert cartesian to XNA coordinate system?[/background]

[/font]

I've never dealt with XNA or Flight Gear, but XNA uses a regular right-handed coordinate system, which is precisely the same as OpenGL and by definition a Cartesian coordinate system. By Flight Gear I'm assuming you're referring to this which, if my logic serves me well, is using a left-handed coordinate system (also Cartesian). Hence the conversion you're looking for is simply between handedness (see the second link).

Regarding "wanting the camera to be at the origin", I'm not sure how you assume this relates to the other problem (the camera is always at the origin if you perform similar operations in any coordinate system that place it there), but in terms of transformation you'll want to "transform your geometry by the inverse of the camera transform" (eg "-CameraPosition") to maintain the origin. However, once again, I think the confusion is actually caused by handedness.

Does this solve your problem?

This topic is closed to new replies.

Advertisement