Project

General

Profile

Coordinate Systems

World Coordinates
Nightshade NG’s world coordinates are inherited from OSG’s OrbitManipulator class which serves as the base class for camera (view matrix) control in NG. This manipulator defines y as the up vector, x right, and z into the screen. The camera always moves in world coordinates, though this is typically transparent to the end user. Most body positions are declared and managed in other astronomical coordinate systems as defined below.

All of the following coordinate system transforms inherit from osg::MatrixTransform, so they can be placed on the scene graph and their children will be in the target coordinate system.

VSOP87
NS.WorldToVSOP87 converts from NS12 world coordinates to VSOP87 with z up, x right and y into the screen. Most solar system bodies are children of this transform. The x-y plane can be thought of as the ecliptic (Earth-Sun plane).

J2000
NS.WorldTo2000 converts from NS12 world coordinates to J2000. Taking VSOP87 as a starting point, it rotates 90 degrees about z to place x into the screen and then rotates -23.4 degrees about y to place the x/y plane on the Earth’s celestial equator.

Conventions for model building

Models should be aligned with whatever coordinate system transform they reside under. For example, say you have a ellipsoid model for a body. If the ellipsoid’s polar axis is y aligned (y-up with x-right) then the model is in world coordinates and should not be placed under any coordinate system transform node. However, if the model is z aligned (z-up) then it should be placed under a WorldToVSOP87 transform node. The intent here is to make it easy to add models defined in other coordinate systems without having to worry about conversion. They just need to reside under the appropriate transform node.

Nightshade NG Coordinate system transform node types

WorldToVSOP87()
WorldToJ2000()
J2000ToVSOP87()

The inverse can also be obtained from any of the above classes.