Hi,
I have a depthmap scene with an obj file where the camera is animated and the object is viewed from different angles.
the position of the camera in space is defined by viewx, viewy,viewz, viewoz, and a fov value. The view direction is defined by a hotspot.
In non vr mode this works well:
const spot=krpano.get('hotspot[spottolookat]');
const camerapoint={viewx:0, viewy:0, viewz:0, viewoz:0, fov:90};
krpano.actions.lookto(spot.hlookat, spot.vlookat, camerapoint.fov, 'tween(default,1)', true, false);
krpano.actions.tween('view.tx|view.ty|view.tz|view.oz', [ camerapoint.viewtx, camerapoint.viewty, camerapoint.viewtz, camerapoint.viewoz ].join('|'), 0.8, 'linear', () => {
console.log('end of animation');
});
Now I want to create exact same animation in VR mode. The problem: how can I set (or simulate) the field of view "fov" in VR mode? I already experimented with the "plugin[webvr].zoom" value, unfortunately without success:
krpano.actions.tween('view.tx|view.ty|view.tz|view.oz', [ camerapoint.viewtx, camerapoint.viewty, camerapoint.viewtz, camerapoint.viewoz ].join('|'), 0.8, 'linear', () => {
// krpano.call('plugin[webvr].zoom(' + 3 + ')');
krpano.call('plugin[webvr].lookat(' + spot.hotspot.hlookat + ')');
console.log('end of animation');
});
Is there an easy way to change the field of view in VR, e.g. by calculating a new viewpoint tx,ty,tz for the camera?
Thanks for any hints in the right direction!