Lab 6

 

 

Adding triggers to manipulate transforms

 

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

 

Open a browser window and find the documentation for ygTexture in the section labeled geometry.

 

1. Create a ygTexture node and place it at the house frame of reference.

 

What messages are available in yg that are also listed in the documentation for ygTexture?

 

2. Load the image file named door.rgb into the texture node.

 

3. Click once on the texture node to create a parent transform, texture1xform.

 

4. Turn on the edit display for texture1xform, switch back to scene view, and adjust the focus onto the transform.

 

5. Zoom in and use the manipulate message in the node menu to adjust the texture orientation so that it is upright.

 

6. Use the manipulate message to adjust the XZ position into the center of the doorway by clicking on the Y axis (green).

 

7. Use the manipulate message to adjust the size so that the width of the texture fills the doorway.

 

8. Use the size message to adjust the Y size to so that the height of the texture fills the doorway.

 

What is the position of the door transform?

 

9. Place the transform for the door under a another transform and adjust the orientation of the new transform to open the door.

 

What happened?

 

10. Make the texture transform a child of the house frame of reference again.

 

11. Adjust the new transform so that it is located along the left side of the doorway.

 

12. Again, place the door transform under the new transform.

 

What is the position of the door transform?

Why?

 

13. Adjust the orientation to open the door.

 

Which transform did you adjust?

Why?

 

14. Save the scene as lab6a.yg

 

15. Without stopping the application, open lab6a.yg in kate and duplicate the code that creates a wandTrigger inside the house.

 

16. Delete the existing scene in yg and load lab6a.yg

 

17. Remove the button1 event for the second wandTrigger and move it into a doorbell location on the outside of the house.

 

18. Add an event to the wand trigger that opens the door when button1 is pressed and another that closes the door when button2 is pressed.

 

19. Save the scene as lab6.yg

 

20. Click on the File dropdown menu and select Minimize.

 

21. Navigate over to the door and open and close the door.

 

22. Adjust the viewpoint so that the minimized window is visible.

 

23. Click once on the icon to restore it and then press F6 to reset the viewpoint.