Next: transform-incr, Previous: time-interests, Up: GCL Reference

#### 7.2.137 transform

`(transform objectID centerID frameID [rotate|translate|translate-scaled|scale] x y z [dt [smooth]])`
  Apply a motion (rotation, translation, scaling) to object `objectID`; that is, construct and concatenate a transformation matrix with objectID's transform The 3 IDs involved are the object that moves, the center of motion, and the frame of reference in which to apply the motion. The center is easiest understood for rotations: if centerID is the same as objectID then it will spin around its own axes; otherwise the moving object will orbit the center object. There is the special keyword `bbox-center` which may be used for `centerID`. As a result the motion will be relative to the center of the bounding box of `objectID`. Normally frameID, in whose coordinate system the (mouse) motions are interpreted, is `focus`, the current camera. Translations can be scaled proportional to the distance between the target and the center. Support for spherical and hyperbolic as well as Euclidean space is built-in: use the `space` command to change spaces. With type `rotate` x, y, and z are floats specifying angles in RADIANS. For types `translate` and `translate-scaled` x, y, and z are floats specifying distances in the coordinate system of the center object.

  The optional `dt` field allows a simple form of animation; if present, the object moves by just that amount during approximately `dt` seconds, then stops. If present and followed by the `smooth` keyword, the motion is animated with a 3t^2-2t^3 function, so as to start and stop smoothly. If absent, the motion is applied immediately.