How To Use the Camera Projection Matrix

Based on the intrinsic camera calibration of a specific device, which comes from the device profile, you can create a GL projection matrix with the following coordinate frame:  

The camera sits at <0,0,0> and points into the positive z-direction
x-direction is to the right
y-direction is down-wards
Hence, we have a right-hand coordinate system.
Note: This is not how OpenGL does it per default, but since it is just matrix math, we can do whatever we want here.

Coordinate frame

The reason why this coordinate frame is used is because the frame is the same as for targets. The coordinate frame is just rotated by 90 degrees around the x-axis. For targets:

  • x-direction is to the right
  • y-direction is upwards in the target plane
  • z-direction points out of the target-plane  

Assumptions

The effect is as follows, when you make the following assumptions:
  • The projection matrix is set up using the Vuforia tool function.
  • The modelview matrix is set to identity. Normally one would use the modelview matrix to move the object with respect to the camera.
  • Clipping is set up accordingly (for example, from 0.1 to 20).

Effects

  • An object with coordinate <0,0,1> shows up in the middle of the viewport (being one scene unit away from the camera center).
  • If we put the object to <0,0,2> then 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 moves to the right of the viewport center.
  • If we move the object to <0,1,1> then it moves to lower than the viewport center.  
Since the Vuforia API gives the developer access to the intrinsic camera calibration, the developer can also build their own GL projection matrix. This option can be helpful if the developer uses an existing rendering solution that enforces a different convention. In this case the Vuforia pose conversion to GL modelview matrices will need to be implemented to suit that convention.