Hello everyone,
I am implementing support for the HTC Vive in an application that was designed to render stereo images for CAVE environment (is, anaglyph or with stereo glasses).
To render with the Vive on OpenGl, it's very easy to get the projection matrix for each eye, however, the app I am working on requires me to use different parameters, namely the Fov, the image ratio/size, and a parameter called convergence distance or sometimes focal length, which is usually the distance from the viewer to the wall in a cave. This is a standard model for stereo rendering, and more details can be found here for example:
http://paulbourke.net/stereographics/stereorender/
See sections about the "Off-axis" model
I was trying to match the Vive with such model but until now without success.
Do you guys know which model is used to compute the proj matrix of the vive?
Especially, if you look at the matrix (IVRSystem::GetProjectionMatrix), we can see that it is not symmetric:
left projection
+ [0] 0x000000000039b270 {0.756570876, 0.000000000, -0.0577721484, 0.000000000} float[4]
+ [1] 0x000000000039b280 {0.000000000, 0.680800676, -0.00646502757, 0.000000000} float[4]
+ [2] 0x000000000039b290 {0.000000000, 0.000000000, -1.01010108, -0.101010107} float[4]
+ [3] 0x000000000039b2a0 {0.000000000, 0.000000000, -1.00000000, 0.000000000} float[4]
This can be also seen with IVRSystem::GetProjectionRaw, which gives for the left eye:
left -1.39811385
right 1.24539280
bottom 1.45936251
top -1.47835493
Which puzzles me here is that in absolute, left is bigger than right, which indicates that the frustum for the left eye is oriented towards the left, and not towards the center of sight (right of left eye) as it would be expected looking at the model described by Paul Bourke.
Any help, experience would be greatly appreciated.
Thanks