Forum Discussion
andchang
11 years agoHonored Guest
DK2 + "Get Positional Tracking Camera Parameters" function
I'm trying to draw the DK2's positional tracking camera's bounding volume in the 3D space with a wire frame so the user can know where they can safely walk around the VR environment.
Does anyone have a sample Blueprints/C++ function that does this? Thanks!
Does anyone have a sample Blueprints/C++ function that does this? Thanks!
6 Replies
Replies have been turned off for this discussion
- artyom17Expert ProtegeJust FYI: you can visualize it via 'hmdpos showcamera' console command (for debugging purposes). To get the idea how it works you may have a look into FOculusRiftHMD::DrawDebugTrackingCameraFrustum C++ function (in OculusRiftHMD.cpp) Would be nice if anybody has a BP example for that too.
- andchangHonored GuestThanks! This is just what I was looking for.
- spyroExpert Protege"Get Positional Tracking Camera Parameters" seems still broken (UE 4.8). Can't get the position of the camera relative to the user's head...
Would love to create something like a tracking volume visualization if the users comes too close to the borders. - artyom17Expert ProtegeHave you tried 'hmddbg showcamera' console command? That should draw the desired volume.
- spyroExpert Protege
"artyom17" wrote:
Have you tried 'hmddbg showcamera' console command? That should draw the desired volume.
Yes, that works (altough it crashes the engine when I exit the game without disabling it before).
But that's not what I want. I'd like to draw a wire frustum when the user gets too near to the tracking boundaries, similar to this in Titans Of Space (ideally, this should be built-in into the composer right away).
spyro - artyom17Expert ProtegeI'll check the crash.
The 'hmddbg showcamera' just proves that "Get Positional Tracking Camera Parameters" works correctly, since this is what it uses. You just need to translate, scale and rotate (probably) it. You can use FHeadMountedDisplay::DrawDebugTrackingCameraFrustum C++ method (from HeadMountedDisplayCommon.cpp) as an example of using it.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device