Timed transitions and local zoom
Submitted by JacekVR on April 8, 2006 - 11:08.
1.How to make timed transitions between panoramas, that means panorama is moving one circle and then pass smoothly to the next one?
2.How to add a flat image for local zoom, similar to PTviewer's ptzoom extension?
Many thanks in advance
Jacek
fieldOfView | SPi-V dev
Timed transitions
Here is what I achieved so far. Sory if the code seems ugly. (Each part between the dotlines, except the scene header is repeated for each pano):
<scene id="3tranisitions">
<uigroup src="scriptlet-toolbar/toolbar.xml" />
<uigroup src="scriptlet-horizon/horizon.xml" />
..........
<panoelement id="tr1" zorder="0" blend="100">
<image id="IcePalaceDay(image)"><layer class="base" type="bitmap" src="jpg/lodd.jpg" /></image>
</panoelement>
<panoelement id="tr2" zorder="1" blend="0">
...........
<behavior object="_scene">
<action event="enter" type="setProperty" property="active" value="true" target="delay" />
</behavior>
.......
<ramp id="delay" duration="40" active="true" loop="true" >
<behavior><action event="loop" type="setProperty" property="active" value="true" target="blender" /></behavior>
</ramp>
......
<ramp id="blender" value1="0" value2="100" duration="3" pingpong="true" active="false">
<behavior><action event="change" type="setProperty" property="blend" target="tr2" value='=getProperty("blender","value")' /></behavior>
</ramp>
</scene>
</tour>
the test is here:
http://www.eu3d.com/sw/transitions.htm
The movie hangs every 3 minutes in half-transition state and you need to click on it to recover.
My question is how to improve this code in the best posible way ?
regards
Jacek
problem is in the ramps...
The problem is in the ramps.
You have 3 ramps that run concurrently. One is set to a duration of 40, the second 80 and the third 120. In the time that the third ramp loops once, the first one has looped 3 times. The first time round, this probably works out ok, but then it gets iffy; it takes 120 seconds (your 3 minutes) for the third ramp to 'reset'.
Instead you probably want the three ramps to do their stuff one after the other. There are two approaches: cascading the ramps, or offsetting the ramps.
Cascading
None of the three ramps should 'loop'. If one timer reaches the end, it triggers the next timer, etc. The last timer triggers the first timer.
Offsetting
All ramps should have the same duration, and be set to be active at the same time. However, you give each timer a different 'offset', so each ramp reaches its loop at a different time within the set duration. You can introduce the offset by setting the 'value' attribute of the ramp.