Hi there,
I want to make a better UX for our virtual tours and therefore I want to add a subtle change of panorama movement when a
visitor
moves with the mouse or trackpad. So that the visitor instantly see
there is somehing to explore (some people just miss that is a 360
sometimes).
I try to make something, but i'm not really get it sort out. Maybe there is a plugin for it, I think it's a small code.
I have this now:
https://360virtualtours.nl/inthemaking/demotour/vierkantje
The code I attach to Mousemovement is:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
var zoomScale = Math.tan(krpano.get('view.vfov') * 0.5 * Math.PI / 180);
zoomScale = 1 / zoomScale;
zoomScale = Math.max(zoomScale, 1 / zoomScale);
var new_ry = followFactor / zoomScale * followRange * (krpano.get('mouse.x') / krpano.get('area.pixelwidth') - 0.5);
var new_rx = followFactor / zoomScale * followRange * (krpano.get('mouse.y') / krpano.get('area.pixelheight') - 0.5);
track_ry = actual_track_ry * (1 - followSpeed) + new_ry * followSpeed;
track_rx = actual_track_rx * (1 - followSpeed) + new_rx * followSpeed;
krpano.set('view.hlookat',track_rx);
krpano.set('view.vlookat',track_ry);
|
It's almost working, but i mis something therefor it pops to some 0 coordinate.
Anybody can help me out here?
Thanks!Aleks