Issues with WebXR

I’m trying to set up a project with THREE JS’s WebVR support, and I’m running into some issues.

My Pixel can show the WebVR example scenes perfectly, but for some reason when I try to implement it on my own project I get the following error: renderer.vr.setFrameOfReferenceType is not a function.

When I compare my scene to the WebVR panorama scene, for example, I’m finding I’m actually missing functions in my renderer.vr object:

  • getController()
  • setFrameOfReferenceType()
  • setFramebufferScaleFactor()

At first I thought maybe my origin trial keys weren’t working, so I explicitly turned on the WebXR Device API and Gamepad Support in my Chrome flags. Still, same issue.

Is there something obvious that I’m missing here?

What version of three.js are you using? Both WebVRManager and WebXRManager provide all mentioned methods since R98.

AHA! That’s probably it. I’m running on a slightly customized version of R94. I upgraded my WebVR file but didn’t think to also update THREE.

I will make the change and report back.

Yep, that was the issue. I merged the latest upstream dev branch with my own fork and it fixed everything. Thanks for the reminder!

1 Like