C API Reference (Version 10.15.3)
VuRenderState Struct Reference

Detailed Description

Vuforia Render State.

Public Attributes

VuVector4I viewport
 Viewport settings.
VuMatrix44F vbProjectionMatrix
 Video background projection matrix immediately suitable for rendering in OpenGL.
 Video background mesh. More...
VuMatrix44F viewMatrix
 View matrix (inverse of device pose) immediately suitable for rendering in OpenGL. More...
VuMatrix44F projectionMatrix
 Projection matrix (using near/far plane values set in render controller) More...

Member Data Documentation

◆ vbMesh

VuMesh* vbMesh

Video background mesh.

Set to NULL if the state is acquired before the first camera frame is retrieved by Vuforia or if running on a see-through eyewear device
The video background mesh is bound to the lifetime of the VuState it was retrieved from. Do not use this pointer or the data it points to beyond the lifetime of the respective VuState.

◆ viewMatrix

VuMatrix44F viewMatrix

View matrix (inverse of device pose) immediately suitable for rendering in OpenGL.

This is set to the identity matrix if there is no active device pose observer. For details about the convention used, see the documentation of VuMatrix44F.

◆ projectionMatrix

VuMatrix44F projectionMatrix

Projection matrix (using near/far plane values set in render controller)

Vuforia Engine creates a projection matrix from the latest intrinsic camera calibration information available on the current device, which you can retrieve from the Vuforia State via vuStateGetCameraIntrinsics(). The projection matrix uses an OpenGL-style column-major matrix with the following right-handed coordinate system convention for the view space:

  • The X coordinate system axis points to the right and the Y axis points downwards.
  • The camera is positioned at the coordinate system origin and points in the positive Z direction.
  • Normalized device coordinates are used where the Z coordinates are normalized to the range (-1, 1).

Rendering solutions using a backend with the same matrix convention as OpenGL can use the matrix as is, while those with a different convention (e.g. DirectX) require conversion before use.

Vuforia Engine's projection matrix convention is described as follows. Let's assume that the pose matrix retrieved from an observation via vuObservationGetPoseInfo in VuPoseInfo.pose is set to identity, and the near/far clipping planes have been set up accordingly (e.g. from 0.01f to 100.0f) via vuRenderControllerSetProjectionMatrixNearFar().

  • An object with coordinates (0,0,1) will show up in the middle of the viewport, being one scene unit away from the camera center.
  • If we place the object at (0,0,2), it will still be in the middle of the viewport but at half the size as before.
  • If we move the object to (1,0,1), then it will move to the right of the viewport center.
  • If we move the object to (0,1,1), then it will move to lower than the viewport center.

Since the Vuforia Engine API provides access to the intrinsic camera calibration, you can always build your own projection matrix if your application uses a rendering solution that requires a different convention. In this case, the observations' pose matrix must be also converted accordingly.