Field of view demo¶
If you have the VastPark Player installed, download the example IMML file below and open the demo in the VastPark Player.
Overview¶
Demonstrates changing a camera’s field of view.
Instructions¶
None
WalkThrough¶
The main objective of this demonstration is to show the use of Timelines. Timelines are used to change the properties of elements, activate scripts over a period of time.
1 <Timeline Name="Timeline" Enabled="True" Speed="1" Loop="True" AutoTween="True">
2 <PropertyEvent Target="FOV" Value="10" Time="00:00:20" Element="TheCamera" />
3 <PropertyEvent Target="FOV" Value="62" Time="00:00:40" Element="TheCamera" />
4 </Timeline>
The above snippet of code has alot going on. So let's focus on the bits and pieces.
1 <Timeline Name="Timeline" Enabled="True" Speed="1" Loop="True" AutoTween="True">
The above line of code is the starting tag to the Timeline element, Timeline elements can have child elements in them, in this case we have PropertyEvent elements.
In the tag we have the attributes, Loop and Autotween. Loop simply determines whether this timeline will start again when it has finished.
Autotween is the changing of a variable over time in a linear fashion. In this case it changes the camera's FOV gradually over the timeline as opposed to changing from one value to another instantly. In this example, by 20 seconds, the camera's FOV will be at 10.
1 <PropertyEvent Target="FOV" Value="10" Time="00:00:20" Element="TheCamera" />
2 <PropertyEvent Target="FOV" Value="62" Time="00:00:40" Element="TheCamera" />
These two elements are Property Events, they alter the properties of a target element by changing the target attribute of a target element. In this case it is changing the FOV of "TheCamera" to 10.
There are two of these Property Events and they occur in sequence, meaning the first Property Event will be executed first followed by the second. They do not happen concurrently within the timeline.
The Final element we will review is the Execute event element.
1 <Timeline Enabled="True" Loop="True">
2 <ExecuteEvent Element="OutputFOV" Time="00:00:02"/>
3 </Timeline>
In the Snippet above The timeline will execute the element, in this case a script at 2 seconds into the timeline, since the Timeline is looping it will cause the Timeline to execute the script every 2 seconds.