[SOLVED] VR orbit camera - almost had it

While trying out some extra VR-features to a project, I was wondering if I could give something back to this community … And I guess I came some what close, with this try of merging the VR device gyro-orientation and the more traditional mouseinput.
Still, a final conversion to yaw and pitch, from the lookat-object coordinates strands:

I am - as one can tell (at mouse-input.js[.onMouseMove .updateVRcoords], look-camera.js [.update]) - trying to find correlation between gyro-output at look-camera.js and yaw/pitch at mouse-input.

While there might not be an easy conversion, I hope you give it a try/and help me … or proactively make a solution, that can lay within the VR-tuts (https://developer.playcanvas.com/en/tutorials/?tags=vr) … and there by ‘fixing the challenge’ for future coders :slight_smile:

1 Like

Ok, ‘could not see the forrest for the blocking trees’ :-/
Anyway got it done myself with a simple touch, that you/PC-admins can use at the tuts also.

Here is how to do it:
Make a Mirror-positioned camera as child to the camera (from there find a way to disable first camera view (several ways to do so afterwards):

  • and the mirror cam:

PS: the 80% camera-split is partially one of the ways as part of my debug (to remove first cam, set the split to 0/100 instead of 20/80)

I’m not 100% what you are doing here in terms of functionality?

Is this an orbit camera for VR?

Yes, turn your head (wearing VR-gear) and the cam will orbit. I actually remember doing this in a Unity project also.

Actually I should have taken this scrdump instead (first cam’s view):