czm_eastNorthUpToEyeCoordinates

czm_eastNorthUpToEyeCoordinates

Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.

The ellipsoid is assumed to be centered at the model coordinate's origin.

Parameters:
Name Type Description
positionMC vec3 The position on the ellipsoid in model coordinates.
normalEC vec3 The normalized ellipsoid surface normal, at positionMC, in eye coordinates.
Returns:
mat3 A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
Example
// Transform a vector defined in the east-north-up coordinate 
// system, (0, 0, 1) which is the surface normal, to eye 
// coordinates.
mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
Source: