Lab 3

 

 

Manipulating ygTransform Nodes in the Scene Graph

 

Create a scene with the following items:

 

1. Add a ygEnvironment node with skyColor (0.1 0.3 0.7)

 

2. Add a ygLight node with direction (1 -1 1)

 

3. A ygObject with the file terrain.pfb sized to (2 2 1)

 

4. A ygObject with the file house.pfb located at (10 20 0)

 

5. A ygObject with the file table.pfb located at (12 23 0)

 

6. A ygObject with the file lamp.pfb located at (12 23 0.5)

 

7. Scale the lamp so that it is an appropriate size for the table

 

What happens to the table when you change the position of the house?

What happens to the lamp when you change the position of the table?

 

Arrange the table in the scene graph so that it is transformed relative to the center of the house model.

Arrange the lamp in the scene graph so that it is transformed relative to the center of the table model.

 

What are the new positions for the table and lamp?

What happens when you change the position of the house?

What happens when you change the position of the table?

 

8. Add a ygObject with the file bulb.pfb located at the appropriate location relative to the lamp

 

9. Scale the bulb so that it looks appropriate for the lamp

 

10. Add a spotLight node to the scene by placing it under the bulb transform

 

What is the position of the bulb transform?

What is the actual position of the bulb model?

Break the lamp transform into 2 transforms so that the bulb position does not have to be compensated for the scaling of the lamp.

 

Some leaf nodes such as the spotLight node do not work properly when they have been scaled.

Add another transform to the scene so that the spotLight is not affected by the scaling of the bulb.

Did the lighting change in the scene?

 

11. Save your scene as lab3.yg