Forum Discussion
DauBe
11 years agoHonored Guest
Hey newbie developer using unity
Hi Everyone,
I currently have a DK1 and i'm trying to Output the oculus's Y rotation values to an outside application using either TextWriter or some other drive connect. but i'm having trouble grabbing the Y rotation values and i don't know where they are updated. my end goal it to send these values to a java script any help is appreciated thanks!
I currently have a DK1 and i'm trying to Output the oculus's Y rotation values to an outside application using either TextWriter or some other drive connect. but i'm having trouble grabbing the Y rotation values and i don't know where they are updated. my end goal it to send these values to a java script any help is appreciated thanks!
1 Reply
- drashHeroic ExplorerHere's some code to do this. Not 100% sure it compiles, but it should point you in the right direction:
If you're using an old SDK for this (pre 0.4.3), you'll want to look at OVRDevice.GetPredictedOrientation().Quaternion currentOrientation = Quaternion.identity;
OVRDevice.GetPredictedOrientation(0, ref currentOrientation);
float currentOrientationY = currentOrientation.eulerAngles.y;
If you're using a more recent SDK (0.4.3 and newer), you'll want to look at OVRManager.display.GetHeadPose().if(OVRManager.display != null)
{
OVRPose currentHeadPose = OVRManager.display.GetHeadPose();
float currentOrientationY = currentHeadPose.orientation.eulerAngles.y;
}
Hope that helps!
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
- 4 years ago
- 3 years ago