czm_modelToWindowCoordinates
Transforms a position from model to window coordinates. The transformation
from model to clip coordinates is done using czm_modelViewProjection.
The transform from normalized device coordinates to window coordinates is
done using czm_viewportTransformation, which assumes a depth range
of near = 0
and far = 1
.
This transform is useful when there is a need to manipulate window coordinates
in a vertex shader as done by BillboardCollection.
This function should not be confused with czm_viewportOrthographic,
which is an orthographic projection matrix that transforms from window
coordinates to clip coordinates.
Parameters:
Name | Type | Description |
---|---|---|
position |
vec4 | The position in model coordinates to transform. |
Returns:
vec4
The transformed position in window coordinates.
Example
vec4 positionWC = czm_modelToWindowCoordinates(positionMC);