next up previous contents index
Next: Methods on Scene Up: The Data Hierarchy Tree Previous: The Data Hierarchy Tree

Scenes - A Collection of Geometry Objects

 

The class Scene can be used to manage a collection of geometry objects. Every geometry object, e.g. any triang or finite element (fe) instance, may belong to an instance of class Scene. This connection is implemented by an instance pointer object. The list of scenes are chained by the pointer next-scene. The whole structure looks like a binary tree. Each scene and geometry object belongs to one node.

The properties of one scene have only an effect to the corresponding object and not to the next scene. These properties are a transformation matrix, a display method and surface properties.

Depending on the matrix-flag the given matrix object-trans will be premultiplied to the corresponding global transformation matrix. For a proper usage of the objects it is necessary to implement the methods which are demanded by the scene's method pointer method-name. If this pointer is not equal to NULL the named method is executed instead of the common "display" method. The available surface properties are explained in the last typedef.

These are the structures belonging to class Scene:

 

typedef struct scene {
    ...
    /* superclass structure */
    struct scene *next_scene;
    INSTANCE *object;
    MATRIX44 object_trans;     /* matrix to transform the objects   */
    int matrix_flag;           /* NULL (id matrix), G_MATRIX_PROJECT,
                                  G_MATRIX_VIEW, G_MATRIX_MODEL    */
    char *method_name;         /* method to use instead of display */
    SUPROP *suprop;
} SCENE;

 

typedef double MATRIX44[4][4];

 

typedef struct suprop {
    ...
    /* superclass structure */
    SUPROP_DEV suprop_dev;
    int grid_patch;
} SUPROP;

 

typedef struct suprop_dev {
    double emission[3];         /* rgb color emission (incl. intensity) */
    double ambient[3];          /* ambient rgb reflectance */
    double diffuse[3];          /* diffuse rgb reflectance */
    double specular[3];         /* specular rgb reflectance */
    double specular_exp;        /* specular reflectance exponent */
    double transparency;        /* transparency factor [0..1] */
} SUPROP_DEV;





SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.