next up previous contents index
Next: Labels Up: More Mirage Features Previous: Rotating an object: Satellite

Affects

    An Affect is a tool for modifying the scene after it is created. This is useful because you can find the position of any object in the scene and change the scene depending on this.

In an Affect class you can make the same changes to the scene that you can make when you initially create the scene. You can add new objects, do transformations, LINK objects together, and change the material and texture properties of an object. The advantage is these changes can be dependent on the positions of other objects in the scene. While you are constructing the scene you do not know the position of objects unless you keep track of them yourself. With an Affect you don't have to. This allows you to create affects such as making objects face one another, change colour depending on how close other objects are etc.

To create an Affect you subclass the Affect class and apply the subclass Affect to an object in the scene.

The Affect class must have a constructor, a destructor and a member function affect_object. affect_object is called internally by Mirage and has the object which the affect is applied to as a parameter.

If you want a pointer to any other object or to know the position of an object, the object needs to be labeled.





Sophie Day
Fri Feb 20 15:47:19 NZDT 1998