I'm using this function
Code: Select all
pano.getPositionRawAngles(x:Number,y:Number):Object
With a tilt = 0 everything is ok.
As the tilt increases (- / +) accuracy is lost
The code to move the hot spot
Code: Select all
var pan = pano.getPan();
var tilt = pano.getTilt();
if( pan < 0 ) { pan = pan + 360 ; }
// Click position in pixel
var offset = $(this).offset();
var ex = e.pageX - offset.left;
var ey = e.pageY - offset.top;
var myscreensize = pano.getViewerSize();
var newex = (myscreensize['width'] - ex) + 25 ; // 25px half width of pointer.png
var newey = ey - 25 ; // 25px half height of pointer.png
var myposition = pano.getPositionRawAngles(newex,newey);
var mypositionpan = myposition['pan'];
mypositionpan = mypositionpan + pan ;
var mypositiontilt = myposition['tilt'];
mypositiontilt = mypositiontilt + tilt ;
// Move hotspt
pano.updateHotspot("myid",mypositionpan , mypositiontilt );
Here https://www.cervellati.com/hotspotfollow/ is a working example exported from pano2vr7 beta