Lab 11

Using the grabber and nodeTrigger


1.  Open your file, vrml.yg, and save it as secret.yg.

2.  If you have not done so already, increase the total duration on your existing timers to 10 seconds.

3.  Load the models rock1.pfb and rock2.pfb and place them on the ground next to where the stairs appear.

4.  Configure the first rock object with a grabber that can be grabbed by holding down button1 when near.

5.  Position a nodeTrigger above the second rock object with debugging on, a spherical volume, and a radius of 0.25.

6.  Configure your nodeTrigger to detect(ygObject) and start the first timer when an object enters.

7.  Now add a third rock to the scene with model rock3.pfb and configure it with a grabber as you did the first rock.

8.  Note that placing either rock inside the trigger will start the timer.

9.  Place a ygNode under the grabber of the first rock and change your nodeTrigger to detect(ygNode).

10.  Note that your nodeTrigger only responds to the first rock now, but this strategy will allow any ygNode to start the timer.

11.  Now, configure the object of the first rock to start the timer when the event secretRock occurs.

12.  Change the nodeTrigger back to detect(ygObject) and change the when message to $node.event(secretRock).

13.  Note now that the first rock is the only object in the scene that can trigger the starting of the timer.