RhinoScript Xform matrices help needed

Hi All,

I can’t wrap my head around the matrices but understand enough to use them in scripts. Now I ran into something I can’t figure out - what I am trying to do is compare 2 Xform matrices (Object A and B) and get the Xforms that I would need to apply to A to get B, or to get from B to A. Is it possible at all with RS ? Even better - Is it possible to have it separated for Scale, Rotation and Translation ?

I have been using @dale’s routines to decompose matrices (thanks Dale!, very helpful) https://github.com/mcneel/rhinoscript/blob/master/DecomposeXform.rvb
but can’t figure out how to use it for the above ‘difference’.

Any help would be much appreciated.

thanks–

Jarek

I don’t think I’m going to be of any help here. You may have to do some research on this.

What specifically are you trying to do?

@dale, thanks, what I am after is this: I have bunch of block instances and want to be able to pick one of them to interactively transform (let’s say Scale) based on it’s plane and base point. Once the transformation is done, I want the same transform to happen to all of the other blocks based on their base points and block planes.
Kind of BoxEdit but for block instances.
Actually, not that I think about it, would be nice to have this option in BoxEdit (Apart from World and CPlane to have BlockPlane… haha)

jarek

Hi Jarek,

Could you not first inverse the current block transformation and store it.

Than transform the block as you like.

Next apply the inverted transform and get the leftover transform.
next invert-transform new-transform re-transform all other blocks.

Disclaimer:
Im quite ignorant about transformation matrices so this might me too naive

-Willem

Hi Willem - this may be a promising approach, even though replicating your idea exactly does not do what’s described above. But gives me a bunch of new things to try, and become a bit less ignorand about matrices - I don’t get most of the Xform methods, I wish there were some more comprehensive descriptions in the help file!
thanks again!

jarek

Here is a simpler (I hope) problem I am trying to solve: how do I set a certain scale of a Block instance with RhinoScript? I can scale by given factor, but so far can’t figure out how to make it be given x,y,z scale (I need translation and rotation not affected…)

-thanks

jarek