WVR_GetProjection

WVR_EXPORT WVR_Matrix4f_t WVR_GetProjection(WVR_Eye eye, float near, float far)

Function to get the projection matrix for the specified eye.

Return
The projection matrix with type WVR_Matrix4f_t to use for the specified eye.
Parameters
  • eye -

    Determines which eye the function should return the projection for.

  • near -

    Distance to the near clip plane in meters

  • far -

    Distance to the far clip plane in meters

Struct and enumeration

struct WVR_Matrix4f

The basic matrix (4x4 floats) struct to be used in pose.

Public Members

float m[4][4]

Matrix form (4X4) to represent rotation and position of pose data.

How to use

Here is an example for the function:

#include <wvr/wvr_projection.h>

void exampleFun() {
    float NearClip = 0.1f;
    float FarClip = 30.0f;
    WVR_Matrix4f_t matLeft = WVR_GetProjection(WVR_Eye_Left, NearClip, FarClip));
    WVR_Matrix4f_t matRight = WVR_GetProjection(WVR_Eye_Right, NearClip, FarClip));
    Matrix4 projLeft = Matrix4(
        matLeft.m[0][0], matLeft.m[1][0], matLeft.m[2][0], matLeft.m[3][0],
        matLeft.m[0][1], matLeft.m[1][1], matLeft.m[2][1], matLeft.m[3][1],
        matLeft.m[0][2], matLeft.m[1][2], matLeft.m[2][2], matLeft.m[3][2],
        matLeft.m[0][3], matLeft.m[1][3], matLeft.m[2][3], matLeft.m[3][3]
    );
    Matrix4 projRight = Matrix4(
        matRight.m[0][0], matRight.m[1][0], matRight.m[2][0], matRight.m[3][0],
        matRight.m[0][1], matRight.m[1][1], matRight.m[2][1], matRight.m[3][1],
        matRight.m[0][2], matRight.m[1][2], matRight.m[2][2], matRight.m[3][2],
        matRight.m[0][3], matRight.m[1][3], matRight.m[2][3], matRight.m[3][3]
    );
}