Various geometry and linear algebra utility functions. More...
Functions | |
VUFORIA_API Matrix44F | convertPose2GLMatrix (const Matrix34F &pose) |
Convert a 3x4 Vuforia pose matrix to an 4x4 column-major OpenGL model-view matrix. More... | |
VUFORIA_API Matrix44F | convert2GLMatrix (const Matrix34F &matrix34F) |
Convert a 3x4 Vuforia matrix to an 4x4 column-major OpenGL matrix. More... | |
VUFORIA_API Matrix44F | convertPerspectiveProjection2GLMatrix (const Matrix34F &projection, float nearPlane, float farPlane) |
Convert a 3x4 Vuforia perspective projection matrix to a 4x4 column-major OpenGL matrix. More... | |
VUFORIA_API Vec2F | projectPoint (const CameraCalibration &calib, const Matrix34F &pose, const Vec3F &point) |
Project a 3D scene point onto a camera image. More... | |
VUFORIA_API Vec2F | projectPointToPlaneXY (const CameraCalibration &calib, const Matrix34F &pose, const Vec2F &screenPoint) |
Project a camera coordinate onto a plane with given pose. More... | |
VUFORIA_API Matrix34F | multiply (const Matrix34F &matLeft, const Matrix34F &matRight) |
Multiply two Vuforia pose matrices together and return the result. More... | |
VUFORIA_API Matrix44F | multiply (const Matrix44F &matLeft, const Matrix44F &matRight) |
Multiply two Vuforia-style 4x4-matrices (row-major order) and return the result. More... | |
VUFORIA_API Vec4F | multiply (const Vec4F &vec, const Matrix44F &mat) |
Multiply a vector and a Vuforia-style 4x4-matrix (row-major order) and return the result. More... | |
VUFORIA_API Vec4F | multiply (const Matrix44F &mat, const Vec4F &vec) |
Multiply a Vuforia-style 4x4-matrix (row-major order) and a vector and return the result. More... | |
VUFORIA_API Matrix44F | multiplyGL (const Matrix44F &matLeft, const Matrix44F &matRight) |
Multiply two OpenGL-style matrices (col-major order) and return the result. More... | |
VUFORIA_API void | setTranslation (Matrix34F &pose, const Vec3F &translation) |
Set the translation part of a Vuforia-style 3x4 pose matrix. More... | |
VUFORIA_API void | setRotation (Matrix34F &pose, const Vec3F &axis, float angle) |
Set the rotation part of a Vuforia-style 3x4 pose matrix. More... | |
VUFORIA_API void | setRotationFromQuaternion (Matrix34F &pose, const Vec4F &quaternion) |
Set the rotation part of a Vuforia-style 3x4 pose matrix. More... | |
Various geometry and linear algebra utility functions.
Convert a 3x4 Vuforia pose matrix to an 4x4 column-major OpenGL model-view matrix.
Vuforia uses 3x4 row-major matrices for pose data. This function takes such a pose matrix (rotation, translation) and returns an OpenGL-compatible model-view matrix.
Convert a 3x4 Vuforia matrix to an 4x4 column-major OpenGL matrix.
Vuforia uses 3x4 row-major matrices. This function takes such a matrix (which may or may not represent a transformation/pose) and returns an OpenGL-compatible matrix.
VUFORIA_API Matrix44F Vuforia::Tool::convertPerspectiveProjection2GLMatrix | ( | const Matrix34F & | projection, |
float | nearPlane, | ||
float | farPlane | ||
) |
Convert a 3x4 Vuforia perspective projection matrix to a 4x4 column-major OpenGL matrix.
Vuforia uses 3x4 row-major matrices for perspective projection data. This function takes such a perspective projection matrix and returns an OpenGL-compatible perspective projection matrix using the given near and far planes.
VUFORIA_API Vec2F Vuforia::Tool::projectPoint | ( | const CameraCalibration & | calib, |
const Matrix34F & | pose, | ||
const Vec3F & | point | ||
) |
Project a 3D scene point onto a camera image.
This function takes a 3D point in scene coordinates and transforms it using the given pose matrix, then projects it onto the camera image and returns the result in pixel coordinates.
calib | The camera calibration, used to compensate for visual distortion |
pose | The pose matrix to use to transform the point. |
point | A point in the same space as the pose matrix that you want to transform to camera coordinates. |
VUFORIA_API Vec2F Vuforia::Tool::projectPointToPlaneXY | ( | const CameraCalibration & | calib, |
const Matrix34F & | pose, | ||
const Vec2F & | screenPoint | ||
) |
Project a camera coordinate onto a plane with given pose.
calib | The camera calibration, used to compensate for visual distortion |
pose | A pose matrix describing the origin and orientation of the plane (the plane itself occupies on the X-Y axes with normal in the Z axis direction) |
screenPoint | The point to project, in camera coordinates (not the same as screen coordinates - see projectPoint()) |
VUFORIA_API Matrix34F Vuforia::Tool::multiply | ( | const Matrix34F & | matLeft, |
const Matrix34F & | matRight | ||
) |
Multiply two Vuforia pose matrices together and return the result.
In order to apply a transformation A on top of a transformation B, perform: multiply(B,A).
VUFORIA_API Matrix44F Vuforia::Tool::multiply | ( | const Matrix44F & | matLeft, |
const Matrix44F & | matRight | ||
) |
Multiply two Vuforia-style 4x4-matrices (row-major order) and return the result.
Multiply a vector and a Vuforia-style 4x4-matrix (row-major order) and return the result.
Multiply a Vuforia-style 4x4-matrix (row-major order) and a vector and return the result.
VUFORIA_API Matrix44F Vuforia::Tool::multiplyGL | ( | const Matrix44F & | matLeft, |
const Matrix44F & | matRight | ||
) |
Multiply two OpenGL-style matrices (col-major order) and return the result.
Set the translation part of a Vuforia-style 3x4 pose matrix.
Set the rotation part of a Vuforia-style 3x4 pose matrix.
pose | The pose matrix on which the rotation should be set. |
axis | The 3D axis around which the pose should rotate |
angle | The angle to rotate around the axis, in degrees. |
VUFORIA_API void Vuforia::Tool::setRotationFromQuaternion | ( | Matrix34F & | pose, |
const Vec4F & | quaternion | ||
) |
Set the rotation part of a Vuforia-style 3x4 pose matrix.
pose | The pose matrix on which the rotation should be set. |
quaternion | A 4D vector describing the rotation to set as a quaternion (x, y, z, w) |