1

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.

  1. What is off-axis and on-axis projection? Do Google Cardboard use off-axis projection?

  2. 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

enter image description here 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!

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Robotic Vn
  • 437
  • 2
  • 7
  • 20
  • 1
    Are you really expecting us to explain how to make a clone of cardboard SDK using OpenGL as answer to your question? Phones are of different size and cardboard optics are different so you have to calibrate the software to project correctly on each case. – Öö Tiib Mar 08 '16 at 16:38
  • Yes, suppose that I have a phone with size XxY. I want to calculate distance need translate based on this size. How can do it? I don't hope create a SDK. I just wanna understand how does it work. Can you help me? Thank you! – Robotic Vn Mar 09 '16 at 02:11

0 Answers0