Package com.j3d.engine.math.rot
Class WorldToCamDirection
java.lang.Object
com.j3d.engine.math.rot.WorldToCamDirection
- All Implemented Interfaces:
RotationMatrixDirection
Implements the
RotationMatrixDirection interface to create rotation matrices
that transform a direction from world space to camera space.
This is the inverse of the standard camera transformation. It's used to determine how world-space objects and directions should appear relative to the camera's viewpoint. For example, this is essential for the rendering pipeline where all world objects are transformed into the camera's local coordinate system before projection.
The matrices generated by this class are the transpose (and thus the inverse) of the
matrices from CamToWorldDirection. The order of multiplication is also reversed,
typically becoming M = Roll * Pitch * Yaw.
- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWorldToCamDirection(double pitch, double yaw, double roll) Constructs a newWorldToCamDirectiontransformer. -
Method Summary
-
Field Details
-
pitch
private final double pitch -
yaw
private final double yaw -
roll
private final double roll
-
-
Constructor Details
-
WorldToCamDirection
public WorldToCamDirection(double pitch, double yaw, double roll) Constructs a newWorldToCamDirectiontransformer.- Parameters:
pitch- The pitch angle in radians (rotation around the X-axis).yaw- The yaw angle in radians (rotation around the Y-axis).roll- The roll angle in radians (rotation around the Z-axis).
-
-
Method Details
-
rotPitch
Creates an inverse rotation matrix for pitch (rotation around the X-axis). This is the transpose of the standard pitch matrix.- Specified by:
rotPitchin interfaceRotationMatrixDirection- Returns:
- A 3x3
MatrixInterfacefor inverse pitch rotation.
-
rotYaw
Creates an inverse rotation matrix for yaw (rotation around the Y-axis). This is the transpose of the standard yaw matrix.- Specified by:
rotYawin interfaceRotationMatrixDirection- Returns:
- A 3x3
MatrixInterfacefor inverse yaw rotation.
-
rotRoll
Creates an inverse rotation matrix for roll (rotation around the Z-axis). This is the transpose of the standard roll matrix.- Specified by:
rotRollin interfaceRotationMatrixDirection- Returns:
- A 3x3
MatrixInterfacefor inverse roll rotation.
-
matrix
- Specified by:
matrixin interfaceRotationMatrixDirection
-