Move! relative vs absolute positioning

Perhaps you are using move for animation. In that case, the move! method’s argument is a transformation whose internal axis represent the local coordinate system of the grouped object, similar to the “transformation=” method (i.e. absolute positioning). I don’t believe its description in the API documentation is correct. I documented this in the “Ruby API Documentation - Errors & Suggestion” topic. It was the post:

To determine whether a transformation argument is absolute or relative, supply it with the IDENTITY transformation constant. Given an entity variable that references a grouped object (Sketchup group or component instance), ensure that is moved off of the Sketchup world origin. Then perform the following:

entity.move! IDENTITY

Do this with an grouped object that isn’t nested inside of another one. If the move method is a relative update operation, then nothing should happened (nothing will happen with “transform!” method either) as applying the identity transformation is like multiplying by 1. The behavior for the “move!” method is absolute, with the following changes occuring:

  • The object’s transformation is set to 0, 0, 0;
  • The object is de-rotated (i.e. its orientation is the same as when it was first grouped); and
  • It is descaled.

Move needs to be used like “transformation=”. In order to apply an incremental operation for those type of absolute or “poses”, then use the following:

jamp_right.move! relative * jamp_right.transformation

The order of the multiplication sequence is important.