Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
bang's avatar
bang
Honored Guest
12 years ago

I'm confusing how to send Oculus rift rotation data

Hello! Oculus Rift developer!

I'm newbie in oculus rift development.

and please understand my bad english.

I have tried to send oculus rift rotation data to opengl model.

If I rotate the oculus rift, cube model in opengl rotate likewise.

so, I used this function

pose.Rotation.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&hmdYaw, &hmdPitch, &hmdRoll);


I got yaw, pitch, roll data.

and I send them to cube model after they were changed from radian to degree.

and I used this function in opengl

glRotatef(rotationY, 0.0, 1.0, 0.0);
glRotatef(rotationX, 1.0, 0.0, 0.0);
glRotatef(rotationZ, 0.0, 0.0, 1.0);


but It is not working correctly.

Once I tried to confirm yaw, pitch, roll data, they varied continously.

I think that the cause of the problem is that.

I really want your help or advice!!

If anybody knows about it, please teach me all of thing!

Thank you very much!

and I wish you understand my bad english!

:lol: :lol:

3 Replies

  • obzen's avatar
    obzen
    Expert Protege
    do you call glLoadIdentity() at the start of the render?

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
  • bang's avatar
    bang
    Honored Guest
    Yes, Of course~!!!

    I confirmed that the cube rotated.

    but Yaw, Pitch, Roll values varies widely.

    e.x

    When the Oculus rift isn't moving, Yaw, Pitch, Roll data isn't changed. <- this is my thought.

    Is it correct?
  • Euler angles are non commutative. That means the order you combine them in will affect the result.

    If the orientation seems wrong, try changing the order of the glRotatef calls.