next up previous
Next: 2.1 Design time Up: Interactive Animation needs Components Previous: 1 Background

2 Position

Interactive animation is a natural application area for component-based systems. The reverse is also true: A component-based approach is vital for the further development of interactive animation systems. In this section, I will motivate these statements.

An important, and obvious, class of components are the objects on the screen. These maintain there own state, containing information such as shape, position, velocity, mass, and visual appearance. They may contain a script that dictates their behaviour, such as a motor driving a machine, but there may be also passive objects, only driven by the laws of nature, such as inertia, gravity and impulse exchanges. This leads to a natural decomposition of the system, namely into objects that our physical model of the world suggests (see figure).

Here, we use the following notion of component. A component corresponds to an object in an object-oriented model. It contains reusable code and a (persistent) state. In simple cases, the only thing that is reused is in fact the code and hence using such a component will not differ much from instantiating an object of a class. For example, a plain wheel is simply an instantiation of the class Wheel. In other cases, however, components contain data that models the graphical appearance, for instance a spoke wheel, which could be a plain wheel, decorated with spokes as an image or a texture. Espacially for more sophisticated components, such as a complete bicycle, it is awkward to design a different class for every version of a bicycle and it is easier to ditribute components as instantiated and initialized objects of a common class. Furthermore, as opposed to a mere class, a component has a design time interface. This will be discussed in the next section.

\includegraphics {model.eps}


 
next up previous
Next: 2.1 Design time Up: Interactive Animation needs Components Previous: 1 Background

C. Huizing and B. Barenbrug
Sept. 2, 1997