I'm trying to write an VR application using opengl on Android. I know it's very simple with Google Cardboard SDK but I want to do it entirely in OpenGL to understand clearly. Now, I have something that I am not clearly. I hope someone help me to clarify.
What is off-axis and on-axis projection? Do Google Cardboard use off-axis projection?
I know that in order to create stereo view for VR, camera should be translate d/2 with d is distance between two eyes. I tried something like this
Matrix.setLookAtM(mViewMatrix, 0, 1, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);//translate 1 according x axis for right eye
Matrix.setLookAtM(mViewMatrix, 0, -1, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);//translate -1 according x axis for left eye
Now, suppose real value of d is 5 cm or d/2 = 2.5cm. How I have to translate camera to correctly? I don't know map 5cm in real world into OpenGL coordinate.
I'm looking forward to the help. Sorry because of my bad English. Thank you!