Set camera to look at a specific place when using device orientation controls in Panolens.js

100 Views Asked by At

I use panolens.js 0.12.1 that is based in three.js 0.105.2

I can easily do

viewer.current.add( panorama.current, panorama2.current ); 
// viewer.current.enableControl(controls.current.DEVICEORIENTATION);    
let camera = viewer.current.getCamera()
camera.position.set(1667, 393, 1072)  
viewer.current.setCameraFov(45)

and when the panorama opens from my laptop I see a specific place that I want. But if I enable device orientation controls

viewer.current.add( panorama.current, panorama2.current ); 
viewer.current.enableControl(controls.current.DEVICEORIENTATION);    
let camera = viewer.current.getCamera()
camera.position.set(1667, 393, 1072)  
viewer.current.setCameraFov(45)

the panorama loads the exact opposite place.

How can I set the camera and/or device orientation to default to a specific place when device orientation controls are enabled?

I found the DeviceOrientationControls source code in the panolens code and tried to edit the initial values

this.screenOrientation = 0;
this.alpha = 0;
this.alphaOffsetAngle = 0;

but nothing changed.

controls.current.DEVICEORIENTATION is not a constructor so I cannot pass values.

How can I achieve this?

0

There are 0 best solutions below