You can use something like …
vec = Geom::Vecter3d::new([1000,4000,1000])
pivot = ORIGIN
move = Geom::Transformation::translation(vec)
rot = Geom::Transformation::rotation(pivot, Z_AXIS, 45.degrees)
A translational transform moves the object(s) along a vector from their current position.
From math, please remember that a vector has a direction and length (magnitude) but not a position.
Use one of the batch form method(s) from the Entities
class:
Where ents
is the parent collection …
objects = [wall, window1, window2, window3, window4]
ents.transform_entities(rot, objects)
ents.transform_entities(move, objects)
So …
I don’t think so. You can try it …
tr = rot * move
ents.transform_entities(tr, objects)
If you do the move first, then the rotational pivot point would no longer be the model’s ORIGIN
, rather …
pivot = ORIGIN.transform(move)
(Just make sure you never change the global reference ORIGIN
point as other extensions also use it. In the above example a new pivot point object is created translated from the existing ORIGIN
point.)