Skip to main content
New Participant
July 13, 2014

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

    Up and Coming
    July 14, 2014
    do you call glLoadIdentity() at the start of the render?

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    DK1 FREAK ...
    bangAuthor
    New Participant
    July 14, 2014
    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?
    kojack
    Honored Contributor
    July 14, 2014
    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.
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3