Understanding Transformation Use Case

Hi there,

Until now I thought that Sketchup::ComponentInstance and Sketchup::Group transformations where local transformation matrix relative to their direct parent. But I bumped into a use case (443.4 KB) that I can’t understand/explanin and for which I need your help. The file is an extract from an existing scene.

In this use case the component instance has a transformation matrix and its direct child group also have the same exact transformation matrix. That means, if I’m right that both counteract each other :

  1. subgroup_transform * cmp_transform.inverse == IDENTITY
  2. the visible shape is a non transformed shaped.

The use case behavior that I can’t understand is that :

  • If I reset the component instance scale transform, the subgroup has its transform reset to an identity matrix (i’m fine with this) but its shape is altered and I can’t understand why…
  • If I explode the component instance, the subgroup keeps the same shape and the same transform matrix… Its not what I was expected, I was much more wating for keeping the same shape but having the transform matrix altered.

These 3 tests aren’t consistants in their behaviour, moreover when using two instances transformed of the same definition we can check that the trnbsformation matrix of the subgroup isn’t the same… How can that be possible ?

Any idea ? Can anyone give me a clue of what is happening here ?

Thanks :wink:

Now that I’m taking a bit of distance, maybe the transformation method always return a world transformation matrix. This would explains the behaviours described above.

SketchUp uses coordinates system in a quite odd and unexpected way. If an entity is in the active drawing context, or a parent drawing context to the active one, coordinates (points, vectors and transformations) are in model space. In other drawing contexts coordinates are in local space (relative to the local axes).

2 Likes

Thanks @eneroth3 for your answer I also just bumped into one of your previous post.

This is fine to me I better understand how to deal with this :wink: