Forum Discussion
oneirophonics
11 years agoHonored Guest
Matching Rift DK2 Position to Real-Life Modeled Object
Using photogrammetry and Autodesk Memento I have created a to-scale FBX model of a real-life plinth I have here, and I'm trying to match my OVRPlayerController to the in-engine Plinth Model so that when a user picks up the headset in real life, which will be resting on the edge of the plinth, the plinth will appear in the same position in the virtual world relative to the real world.
I have set up my IPD correctly, and my height measurements, but the scale still seems off, like I'm looking down at a smaller, lower model.
Am I doing anything wrong here? Can I tell the headset to place itself 1m above ground (the height of the top of the plinth) so that when a user picks up the headset, it will adjust the camera to reflect the individual user's height, and the scale of the virtual plinth will match its real world counterpart?
Please excuse the mess, I'm working off my girlfriend's dresser while we're moving house :roll:
http://imgur.com/a/jBIQw
I have set up my IPD correctly, and my height measurements, but the scale still seems off, like I'm looking down at a smaller, lower model.
Am I doing anything wrong here? Can I tell the headset to place itself 1m above ground (the height of the top of the plinth) so that when a user picks up the headset, it will adjust the camera to reflect the individual user's height, and the scale of the virtual plinth will match its real world counterpart?
Please excuse the mess, I'm working off my girlfriend's dresser while we're moving house :roll:
http://imgur.com/a/jBIQw
8 Replies
Replies have been turned off for this discussion
- petereptProtegeTry calling InputTracking.Recenter() when the DK2 was sitting on the plinth?
- ezRocketProtegeThat'd be amazing if there'd be a way to automatcally recognise the height etc. of the player.
- AnonymousHi i read your post and i am currently trying to do something similar. I have a big touch display and want to show this in my virtual world at exactly the same position.
Have you found a solution yet ?
And does somebody know if you can get the distance from the IRCamera to the Rift in Unity? - vrdavebOculus StaffOne way of making your reference frame match the real world is by using OVRManager.tracker.GetPose(). That returns the pose of the IR tracker camera relative to the initial center eye pose. You can then adjust the pose of OVRCameraRig's TrackingSpace GameObject to make things line up.
- AnonymousI tried it for some time now, but i cant get it to work 100%... Also i didnt really get your explanation 100% sorry ^^ I am quite new to VR Scripting in unity.
Can somebody describe the steps necessary to line up a real object with a virtual one? I set the IPD and Person Height in the Oculus SDK Manager.
Does the OVRManager.tracker.GetPose() give me the position of the IR Camera in Virtual Space?
When i call InputTracking.Recenter (); does it reset just the orientation or also the Persons Height again?
Would be great if somebody could help me again :) Thanks! - vrdavebOculus Staff
"awefgeagarhar" wrote:
Can somebody describe the steps necessary to line up a real object with a virtual one?
1) Pick an "origin" for your world. Let's call that "meatSpaceOrigin". For the sake of this post, let's say you make it equal to the pose of your IR camera in the real world. When a GameObject's Transform.position and rotation.eulerAngles are both (0,0,0), it's going to be at meatSpaceOrigin in the real world.
2) Add a "calibration" function. When the user presses a button or maybe when the app starts, you're going to want to call a function that assumes the IR camera is at meatSpaceOrigin in the real world and moves the OVRTracker to (0,0,0) to line up with it. The function will probably look something like this:void Calibrate()
3) Call the function each time the user recenters the tracking pose:
{
OVRCameraRig rig = GameObject.FindObjectOfType<OVRCameraRig>();
rig.trackingSpace.FromOVRPose(OVRManager.tracker.GetPose().Inverse());
}void Start() {
OVRManager.display.RecenteredPose += Calibrate;
}"awefgeagarhar" wrote:
OVRManager.tracker.GetPose() gives you the IR camera's pose in Unity's world space (like Transform.position and Transform.rotation).
Does the OVRManager.tracker.GetPose() give me the position of the IR Camera in Virtual Space?"awefgeagarhar" wrote:
Yes. InputTracking.Recenter() moves the headset tracking data so that its origin (0,0,0) matches the user's current head position at the time the function is called. This is exactly what we need to undo in our Calibrate() function.
When i call InputTracking.Recenter (); does it reset just the orientation or also the Persons Height again? - AnonymousThank you very very much! It now works perfectly!
But because i also want to really understand it what you are doing i have one more question because i cant find any infos online:
What does the FromOVRPose Function do with the Pose of tracker? And you just Inverse it because you want to position the objects in the positive Z-Axis?
Does the FromOVRPose just move the IRCamera to (0,0,0)?
Thanks again! - vrdavebOculus Staff
"awefgeagarhar" wrote:
What does the FromOVRPose Function do with the Pose of tracker?
Transform.FromOVRPose(OVRPose pose) is just an utility extension method that sets the Transform to equal the given OVRPose. We use OVRPose in a few cases (like this) to implement math operations like the inverse since they aren't built into Transform.
The inverse is needed because we want TrackingSpace * TrackerAchor = Identity (aka meatSpaceOrigin).
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device