ptviewer: How to avoid flickering when switching panos?

1 message Options
Embed this post
Permalink
Jan Martin

ptviewer: How to avoid flickering when switching panos?

Reply Threaded More More options
Print post
Permalink
Hi all,

I think I solved the pan tilt fov issues I had with ptviewer.

However one issue is left:
When switching panos there is a short period of white background.
Because I preload the image and switch only when it is loaded this seems to
be a ptviewer issue?

Any ideas how to solve this?

Thanks,
Jan

Relevant code so far:

function nextpano() {
nextimage = nextimage+1;

nextimagefilename='panos/'+zeroPad(nextimage,8)+'.jpg';

// NO preloading
// switchpano(nextimagefilename);

/* PRELOADING
buffer = new Image();
buffer.src=nextimagefilename;

// testing: No difference between: onLoad and complete
//buffer.src.onLoad   = switchpano(buffer.src);
  buffer.src.complete = switchpano(buffer.src);
*/
}

function switchpano(loadedimage) {

pan =document.ptviewer.pan();
tilt=document.ptviewer.tilt();
fov =document.ptviewer.fov();

nextstring ='{file='+loadedimage+'} {pan='+pan+'} {tilt='+tilt+'}
{fov='+fov+'}';

document.ptviewer.newPano(nextstring);
}


[Non-text portions of this message have been removed]