OrbitControls stop working when grouping camera for XR

I have just added my camera to a group so I can set its position in VR in the demo below:

https://xr.webvr.dev/ex/three.js/points2/ex8.html

VR works, which is great, but now OrbitControls doesn’t work.

Here’s the previous version where it worked:

Is it obvious to any of you why this stopped working? I assume it’s something I just don’t understand.

Thanks,
Austin

Oh, this is probably a clue (source)

object: (required) The camera to be controlled. The camera must not be a child of another object, unless that object is the scene itself.

So by placing the camera into a Group, I probably break it. To me, this implies that OrbitControls and positioning the VR camera are mutually exclusive. Is there some workaround?

1 Like

I haven’t come back to this project yet, but I’ve been thinking about solutions. Could I only put the camera in the group when entering VR mode? Or … could I have two cameras, one for 2D and one for 3D and switch between them?

Anyone has come up with a solution yet?

I still haven’t come back to this project. I was hoping someone more knowledgable would chime in.

Yeah use another camera until entering VR, or a potential sudo idea would be to have a ghost secondary camera with orbit controls on it and apply this ghost camera matrix to the parent group containing your primary camera (maybe?)