How to get camera rotation in WebVR? [SOLVED]

I would like to build a navigation during stereoscopic VR panoramas.

My code for mobile devices does work, but how do i get the camera rotation angles when
driven by a VR device ? (Oculus Go for example)

[still WIP, links deleted]

Thanks for feedback and critic.

I’ve tested your application with Daydream. The initial screen is black but as soon as I start the VR experience everything seems to work fine. What do you exactly mean with “how do i get the camera rotation angles when driven by a VR device”?

Thanks for your help, let me explain.

I debug print out the longitude and latitude with the mobil device version and wrote down the numbers for some specific viewing directions.

With that numbers in an array, i check within the animation function if the user looks in the direction where is another panorama available.

When looking in that direction, a circular progressBar should display and forward the browser to view the choosen panorama.

Here a Screenshot from my mobildevice.

So, how could i get the VR-Device driven camera angles to achiev that behavior ?

For the desktop version i worked with hotspots. I think will not work in VR so i looked out for another solution.
[still WIP, links deleted]

Doesn’t it work if you just use camera.getWorldDirection()? You can also extract the rotation from camera.matrixWorld. The VR/XR manager should update the transformation of the current camera according to the head’s transformation.

You are correct, i messed up the getWorldDirection() function call.
So that does work now !

Thanks a lot, for pushing in the right direction :slight_smile: .

I’ll come over with some other bugs if i cannot manage to fix them.