Multi transform an Object

I need to transform.translate anobject and then transform.rotate it too,
is there any way to do it one time?
like:
var tr = new transform();
tr.translate …
tr.rotate …
and then:
Rhinodoc.Activedoc.Objects.Transform(Myobj , tr );
and it commits the rotation and translation one time?
thanks.

You might want to check out quaternion translations…

This is another file @DanielPiker posted a while ago, not sure in which topic

quaternion_translation_c.gh (23.9 KB)

Hi @arc.feizbahr,

Try doing something like this:

var xf_scale = CalculateScaleTransform(...);
var xf_move = CalculateTranslationTransform(...);
var xf_rotate = CalculateRotationTransform(...);
var xform = xf_rotate * xf_move * xf_scale;
doc.Objects.Tranform(obj, xform);

– Dale

1 Like

Thanks Martin,
But I’m not doing it in grasshopper.

Thanks Dale,
It’s exactly what I need,
I just couldn’t find CalculateScaleTransform or alculateTranslationTransform or CalculateRotationTransform, could you please tell me where it is? or what the namespace is?
Or if it is a custom function can you describe it a little for me please?
BTW does * really works? Its interesting :upside_down_face:

thanks a lot.

I knew that before posting. The quaternion script is in c#…