HomefieldOfView | SPi-V dev

Navigation

user

Autopan then change scene

Hi Guys,

I have managed to follow the demo projects provided on this site and utilised the scriplets in xml files to trigger events in director.

I am stuck on something though. I have used the following code to load and auto-rotate (using the scriplets) a virtual tour :

-----------------------------------------------------------------------

<tour>
<global>

<meta>
<title>Simple tour with 2 scenes</title>
<defaultview scene="scene1" pan="180" tilt="-" fov="70"/>

     <cameralimits
          panmin="-180" panmax="180"
        tiltmin="-35" tiltmax="35"
         fovmin="40"  fovmax="140" />

<cameradynamics
        rotatespeed="2" rotateinertia="0.7"
        zoomspeed="-90" zoominertia="90" />

</meta>

</global>


<scene id="scene1">

<uigroup src="loader.xml" />
<uigroup src="initialmotion.xml" />

<panoelement id="cubicPano1" type="cylindrical" an="0" tilt="0">

<image id="cubicImage1"><layer class="base" type="bitmap" src="#back"/></image>

<action event="ready" type="setView" scene="scene2" pan="90" tilt="0" fov="80"/>

</panoelement>

</scene>

----------------------------------------------------------------------

Does anybody know how I would go about trying to load a new scene (with a new jpg) directly after either a timed period of time or when the "initialmotion.xml" file has carried out its autorotation to a set value?

All help most appreciated!

Martyn.

Re: Autopan then change scene

sorry, the code hasnt added properly

Re: Autopan then change scene

XML code will post nicely if you enclose it between <xml> and </xml> 'tags'.

Re: Autopan then change scene

You would need to add a ramp node to your scene(s). This ramp would have a certain duration (say 20 seconds). Add a behavior to the ramp which includes an action for the 'stop' event which issues a setView to another scene.

This will jump to another scene after the specified time. However, you probably want to jump to another scene only after a period of inactivity. That's what the 'interrupt' attribute of the ramp node is for; you can specify what type of activity interrupts the ramp, causing it to reset.

Re: Autopan then change scene

Thanks Aldo,

Thats works perfectly. I have added the following code to the end of the initialmovement.xml behaviour:

<action event="stop" type="setView" scene="scene2" pan="90" tilt="0" fov="80"/>

I have a new question though now. I am using the script in my initial comment (above) to activate the loader.xml and the initialmovement.xml in scene 1. If I now copy either of these lines into scene 2, I get an error message in Director: "script error: object expected". These are the two lines I am referring to:

<uigroup src="loader.xml" />
<uigroup src="initialmotion.xml" />

My goal is to display one pano cycling through a set of pan values then loading a new pano asap and continuing to "auto-pan" then another... and so on. It is for a show reel for an interactive dvd project.

I am very close to acheiving this now thanks to your help, however just need to get over this final issue. All help most appreciated,

Martyn.

Re: Autopan then change scene

The error you are getting is a bug; SPi-V should handle such errors instead of giving you a Shockwave error. In order to reproduce the error, it would be very usefull if I could have a look at all the XML you are using.

Having said that, why are you putting these scriptlets in the scene? They are meant to be put in the global node.

Re: Autopan then change scene

I have moved the loader scriplet reference to the global node, that did the trick, thank you very much.

This allows me to load an #image, then fade the rotating pano over the top. Putting this in the global node means I can use the same code (and therefore #image) for every scene.

In order to attach a different set of pan instructions to each scene (to reference different pano-images) I have used a separate scriplet for each scene, thats why I feel I need to place the scriplet into each scene node, so that I can reference different xml scripts.

What do you think? Is this the method you would use to achieve this task? It seems to work without error messages but it feels like there might be a more efficient method of coding this?

Here is my completed code:

<tour>
<global>

<meta>
<title>Simple tour with 2 scenes</title>
<defaultview scene="scene1" pan="180" tilt="-" fov="70"/>

     <cameralimits
          panmin="-180" panmax="180"
        tiltmin="-35" tiltmax="35"
         fovmin="40"  fovmax="140" />

<cameradynamics
        rotatespeed="2" rotateinertia="0.7"
        zoomspeed="-90" zoominertia="90" />

</meta>


<uigroup src="loader.xml" />


</global>


<scene id="scene1">


<uigroup src="initialmotion.xml" />


<panoelement id="cubicPano1" type="cylindrical" an="0" tilt="0">

<image id="cubicImage1"><layer class="base" type="bitmap" src="#back"/></image>

<action event="ready" type="setView" scene="scene1" pan="90" tilt="0" fov="80"/>

</panoelement>


</scene>


<scene id="scene2">

<uigroup src="initialmotion2.xml" />

<panoelement id="cubicPano1" type="cylindrical" pan="0" tilt="0">

<image id="cubicImage1"><layer class="base" type="bitmap" src="#test"/></image>

<action event="ready" type="setView" scene="scene2" pan="90" tilt="0" fov="80"/>


</panoelement>

</scene>

</tour>