World Space

How space is defined in eeGeo 3D maps

Working with our World Space

eeGeo 3D Maps’ world space is large. It’s probably not a shock that it’s the size of the Earth. There are interesting challenges in creating a graphics application in such a large world space, specifically related to float precision. This section of the documentation explains our world space, how you work with it, and how to convert between it and other familiar spaces like Mercator.

In this section:

ECEF

Our world space we call ECEF, it is a subtle variation of “Earth Centred Earth Fixed” that we find more appropriate.

  • The origin (0,0,0) is the centre of mass of the earth.
  • The positive X axis passes through the americas at LatLong(0, -90)
  • The positive Y axis passes through the south north pole
  • The positive Z axis passes through the prime meridian (0 longitude) at LatLong(0, 0)

For simplcity, we consider the earth a perfect sphere, of radius 6,378,100m.

Therefore, the exact ECEF position of the north pole, would be (0, 6378100.0, 0)

The units are metres

Visualised, the axis of our ECEF space look like:

Globe Axis

Lat,Long to ECEF

You can quickly convert between LatLong and ECEF using the LatLong and/or LatLongAltitude types found under the maths namespace:

Altitude in the LatLongAltitude type is measured in metres above the surface of the perfect sphere (which is considered sea level)

ECEF to Lat,Long

You can quickly convert between an ECEF Vector3D and a LatLongAltitude using the fromECEF static function on the LatLongAltitude type:

ECEF Tangent Coordinate frame

Apps often need to position and orient objects in a coordinate frame that is tangential to the Earth’s surface. For some point on the Earth’s surface, the patch of the Earth sphere that is locally around that point is approximately flat. We can use this tangent plane to define a local coordinate system that is useful for positioning objects relative to this reference frame.

The “up” direction is perpendicular to the tangent plane – so is in the same direction as a ray from the Earth’s centre passing through our ECEF point on the sphere surface.

The “forward” and “right” directions lie on the tangent plane, perpendicular to each other.

Showing a Tangent Plane on the Earth sphere with the 'Up' axis perpendicular to the planeShowing a Tangent Plane with its 3 coordinate axes

Conventionally, we use a left-handed coordinate system, where:

  • The positive X axis points “right”
  • The positive Y axis points “up”
  • The positive Z axis points “forward”

We provide a class to assist in defining such as coordinate frame: EcefTangentBasis. This can be constructed from an ECEF point and a forward “heading” direction. The class uses these to create the 3 orthogonal basis direction vectors, constrained as described above.

Positioning a Model

We provide a class to assist in defining such as coordinate frame: EcefTangentBasis. This can be constructed from an ECEF point and a forward “heading” direction. The class uses these to create the 3 orthogonal basis direction vectors, constrained as described above.

Visual Debugging

The SDK provides a set of Debug Rendering methods to aid in the understanding of the ECEF coordinate system and help visually debug your scene. This includes methods for drawing lines, cubes, spheres and axes. The complete list of methods can be found on the DebugRenderer type, and an example demonstrating how to use both the DebugRenderer & an EcefTangentBasis is located in this Mobile SDK Harness Example.