next up previous contents index
Next: PointAtAffect Up: Affects Previous: Example Affect: Retrieving Positions

Manipulating a Scene within an Affect Class

To manipulate an object in the DAGnode graph (the graph of objects which represents the scene) the object must be created then bound and then labelled. The object returned by the find command is the object once it has been bound. To change the object requires you to manipulate the DAGnode that the bound object points to. This is pointed to by the details pointer. The details pointer is a pointer to the lower DAGnode in the graph which is the unbound object.

To manipulate this object, make a copy of the object which the details pointer points to, manipulate the object and then point the details pointer to the object.

  the_object becomes a pointer to the lower DAGnode.
  object the_object = (object) the_obj->details;

  //make changes to the_object
  Z =shift(0, 0, 2, Z);
  LINK(Z, PLUS, new_sphere());
  Z = bind(Z)

  //make the_obj point to the new object.  
  the_obj->details = (void *) Z;

Note that any transformations that are applied to a DAGnode apply to all the lower nodes in the graph.



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