Chapter 6. Graphics and Sound

This chapter discusses customizing graphics and sound in a breve simulation.

The first section, Lighting (Section 6.1) shows how to enable and use lighting. The section Shadows and Reflections (Section 6.2) shows how graphics can be enhanced with shadows and reflections. The section on Loading Images (Section 6.3) shows how to load images into a simulation. These images can be used to display an agent as an image (Section 6.4), texture an object (Section 6.5) or display an object as a translucent "lightmap" (Section 6.6).

Finally, the section on Sounds (Section 6.7) shows how sound files can be loaded and played as part of a breve simulation.

6.1. Lighting

Lighting can be used to aid in the visualization of a simulation. By default, lighting is enabled for physical simulations (those which use a controller subclassed from PhysicalControl.tz) and disabled all other simulations.

To enable lighting or disable lighting, use the Control.tz methods enable-lighting and disable-lighting. To move the location of the light, use the method move-light. The following example shows how lighting could be enabled and setup as part of the controller object's init method:

	self enable-lighting. 
	self move-light to (0, 50, 0).