PDA

View Full Version : Autorotator with Tilt Control


Redshift-Blueshift
05-28-2009, 05: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

Redshift-Blueshift
06-10-2009, 04:53 PM
We all know the autorotator plugin is a bit of a CPU pig, but its our pig, so I've decided to add a bit more lipstick and have made a second version of my earlier revision. The first time around I added a tilt control, this time I've added a way to have the autorotator plugin timeout. I've certainly have felt my comp lagging only to find a hidden browser window or two with a pano spinning in circles, I can only imagine what my less savvy clients are doing.

Basically the new param is timeout, and its the number of rotations you want the pano to do before stopping back at the original load pan point. The default is 10, but it can be anything you like. When the specified number of rotations is reached the plugin pauses and frees up the processor. If a person interacts with the pano again, the tour will again autorotate through the specified number or rotations before pausing.

As before, the plugin and fla are included. Feel free to tweak it to your needs.

Duncan