2
votes

With the current WebVR API, I can get headset position & orientation data relative to the zeroState.

But how can I determine where the headset is relative to the positional tracker camera? I'd like to draw a 3D model of the tracker along with FOV constraints in the virtual world, much like the Oculus Config demo scene.

2

2 Answers

3
votes

WebVR does not expose the positional tracker camera via API, and they do not have any plans to expose it as other headsets might not have external cameras. Therefore, it's impossible to determine headset position/orientation relative to the tracker, and there is no frustum data.

"At this point no, because it's not obvious if that will be a common element of many HMDs."

https://twitter.com/Tojiro/status/560614873327869952

1
votes

I'm not too familiar with the WebVR API. Whether it can give you what you need depends on how much of the C API information in the Oculus SDK it might expose.

Within the Oculus C API you have the following:

You can call ovrHmd_GetTrackingState to return a ovrTrackingState structure. This structure includes two ovrPosef members CameraPose and LeveledCameraPose which contain the pose of the camera.

The field of view of the is available in the ovrHmdDesc structure that is returned of ovrHmd_Create which contains the following members

float       CameraFrustumHFovInRadians;
float       CameraFrustumVFovInRadians;
float       CameraFrustumNearZInMeters;
float       CameraFrustumFarZInMeters;

Since the WebVR API is probably attempting to be more platform neutral, it may or may not expose this kind of information. However, it seems even a platform neutral way of doing headset tracking might want to expose some mechanism for informing the client of the positional tracking bounding region. If it doesn't, you should pester the designers to add one.