Texturing Objects
<< previous | Chapter 6. Graphics and Sound | next >>

## Texturing Objects

### Changed in breve 2.0

The methods used for texturing objects have been changed from breve 1.x, so pay close attention to this section if you're updating your simulation from a previous version of breve.

Texturing allows images to be tiled on a 3D object. This is in contrast to the bitmapping described in Displaying Objects as Bitmaps the section called “Displaying Objects as Bitmaps”, in which an image is displayed in place of the 3D object. An example of object texturing is shown below, with a semi-transparent textured cube:

The first step in texturing an object is loading in the texture from an image file. Instructions for loading image files for texturing are given in Loading Image Files the section called “Loading Image Files”. Once the texture image has been loaded, texturing can be done by passing the texture image to the method set-texture-image for any Real object.

As mentioned in Displaying Objects as Bitmaps the section called “Displaying Objects as Bitmaps”, loading multiple instances of the same texture image will be expensive in terms of both memory and performance, so if you're using the same texture on many agents, you should reuse the same Image object. An example of this is shown in Displaying Objects as Bitmaps the section called “Displaying Objects as Bitmaps”.

<< previous | Up | next >>
Displaying Objects as Bitmaps | Table of Contents | Displaying Objects as "Lightmaps"