Lab 7

 

 

Using event data and timers to add dynamics

 

Start yg and load your scene from the last lab, lab6.yg.

 

1. Move both wandTrigger nodes under the house frame of reference.

 

2. Create a text node, place it under a transform, and place it near the wand trigger that opens the door.

 

3. Set the string message of the text node to “security check” and adjust the size, position, and font of the text node as desired.

 

4. Setup the wand trigger to change the text string to the name of the user when the wand enters:

 

when->enter->text1.string(approved: $user)

 

5. Add a timer node to the scene under the root node.

 

6. Set the timer endvalue to 90 and the timer duration to 2.

 

7. Setup the timer changed event to adjust the orientation of the door:

 

when->changed->doorxform.orientation(0 0 $value)

 

What happens when you start the timer?

 

8. Setup the door wand trigger to start the timer instead of directly setting the door transform orientation.

 

9. Turn off any edit displays and save the scene as lab7.yg.

 

10. Minimize the interface and test your scene.

 

11. Restore the interface and move the timer node to the house frame of reference.

 

What happened to the behavior of the timer?

Why?