Forum Discussion
lhsdaniel
10 years agoHonored Guest
how to get the head roration parameter?
So I would like to make a camera rotate as rift users rotate their head. I think there is a build-in parameter that I could directly get from rift. Could somebody instruct me on how to do so?
3 Replies
- cyberealityGrand ChampionYes, it shows this in the documentation. Here are the relevant lines (in C++):
frameTiming = ovrHmd_BeginFrameTiming(hmd, 0);
ovrTrackingState ts = ovrHmd_GetTrackingState(hmd, frameTiming.ScanoutMidpointSeconds);
if (ts.StatusFlags & (ovrStatus_OrientationTracked | ovrStatus_PositionTracked)) {
Posef pose = ts.HeadPose.ThePose;
float yaw, pitch, roll;
pose.Rotation.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&yaw, &pitch, &roll);
} - lhsdanielHonored Guest
"cybereality" wrote:
Yes, it shows this in the documentation. Here are the relevant lines (in C++):frameTiming = ovrHmd_BeginFrameTiming(hmd, 0);
ovrTrackingState ts = ovrHmd_GetTrackingState(hmd, frameTiming.ScanoutMidpointSeconds);
if (ts.StatusFlags & (ovrStatus_OrientationTracked | ovrStatus_PositionTracked)) {
Posef pose = ts.HeadPose.ThePose;
float yaw, pitch, roll;
pose.Rotation.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&yaw, &pitch, &roll);
}
Thank you! but I mean I am really new to oculus rift development. After I plug in oculus rift and set it up, I can just write a C++ program to fetch these parameters right? - cyberealityGrand Champion
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago