Determining the Position of an Instance
 
 
 

To determine the position of a CV in an uninstanced piece of geometry simply use the worldPosition() methods on the various CV classes.

When geometry is instanced it is not possible to use the worldPosition() methods (since they will only indicate the position of the first instance). Instead it is necessary to use the affectedPosition() methods. In the simple case, where instance nodes have no parents there will be distinct paths to the instanced geometry. The method AlDagNode::globalTransformationMatrix() is used to calculate the transformation matrix of the instance node. Use this AlTM and the CV's affectedPosition() method to get the position of the CV in the instanced geometry. In the more complex case of instances being applied to instances, there will be several non unique paths to the geometry. Each path will represent an instanced piece of geometry. It will be necessary to walk each path and accumulate the transformation matrices( while walking down) and then apply that accumulated AlTM to the CV/Vertex positions.