Redshift-Blueshift
05-28-2009, 04:33 PM
Hi All, this was posted in the general forum, but on request here it is again.
Basically, I needed the autorotator to not only do its usual thing, but also to return to the horizon or in some cases some other tilt value. I didn't really feel like doing alot of autotour programming and I couldn't find anything immediately so I just modified the autorotator plugin (actually I modified the latest modified version by nidrig). Here is a demo. Very simply, and you can see in the xml, I added a tilt value which the pano will return to when the autorotation kicks in.
AutorotatorT demo (http://www.redshift-blueshift.com/tester/AutoTilt/autoTilt.html)
The tilt value can also be changed on the fly (the '+' & '-' buttons change the tilt value in the example), so you can have a different horizon/tilt point for each pano. (I used one time linked hotspots to change the tilt value onLoad between panos from a dropdown)
Its not too elegant, but it works and it may make someone's life easier. Heres the swf and source.
Should you want to monkey with it further here is the actual AS3 movement code. The 0.2 is the speed that the tilt will adjust to meet the specified horizon tilt. You can change it to alter the speed and re export the swf or create another parameter to handle it through the xml.
//Check to see if tilt & pano.tilt match and adjust
if (p > tilt + 0.2 || p < tilt - 0.2) {
if (p > tilt) {
pano.tilt = p-0.1;
t_r = pano.tilt_r;
} else {
pano.tilt = p+0.1;
t_r = pano.tilt_r;
}
} //finish tilt adjustment
Also if you need to change the tilt between panos but maybe are using an old drop down menu that won't pass the parameter, just use a linked spot that loads with no visibility. An onLoad function is called to change the tilt. Here's an example:
<spot id="c1" url="panonav/nav001/AR_dot.png"
linked="panos/GPH_001" visible="0" onLoad="external.autorotator.tilt=0; "/>
Enjoy,
Duncan
Basically, I needed the autorotator to not only do its usual thing, but also to return to the horizon or in some cases some other tilt value. I didn't really feel like doing alot of autotour programming and I couldn't find anything immediately so I just modified the autorotator plugin (actually I modified the latest modified version by nidrig). Here is a demo. Very simply, and you can see in the xml, I added a tilt value which the pano will return to when the autorotation kicks in.
AutorotatorT demo (http://www.redshift-blueshift.com/tester/AutoTilt/autoTilt.html)
The tilt value can also be changed on the fly (the '+' & '-' buttons change the tilt value in the example), so you can have a different horizon/tilt point for each pano. (I used one time linked hotspots to change the tilt value onLoad between panos from a dropdown)
Its not too elegant, but it works and it may make someone's life easier. Heres the swf and source.
Should you want to monkey with it further here is the actual AS3 movement code. The 0.2 is the speed that the tilt will adjust to meet the specified horizon tilt. You can change it to alter the speed and re export the swf or create another parameter to handle it through the xml.
//Check to see if tilt & pano.tilt match and adjust
if (p > tilt + 0.2 || p < tilt - 0.2) {
if (p > tilt) {
pano.tilt = p-0.1;
t_r = pano.tilt_r;
} else {
pano.tilt = p+0.1;
t_r = pano.tilt_r;
}
} //finish tilt adjustment
Also if you need to change the tilt between panos but maybe are using an old drop down menu that won't pass the parameter, just use a linked spot that loads with no visibility. An onLoad function is called to change the tilt. Here's an example:
<spot id="c1" url="panonav/nav001/AR_dot.png"
linked="panos/GPH_001" visible="0" onLoad="external.autorotator.tilt=0; "/>
Enjoy,
Duncan