I'd like to remove all transformation for a given instance... so basically reverse what ever moves and rotations were done.
I can get the transformation array,
 Code: Select all
e.transformation.to_a
Thanks
Undoing all transformations
5 posts
• Page 1 of 1
Undoing all transformationsI'm pretty sure I've seen this before but I can't find the answer... so sorry in advanced if this is a repeat question.
I'd like to remove all transformation for a given instance... so basically reverse what ever moves and rotations were done. I can get the transformation array,
Thanks Re: Undoing all transformationsMaybe this?
Re: Undoing all transformationssdmitch, just had a chance to try it out and it does work...
Thanks! Re: Undoing all transformationsAlso, to reset all transformations and puts the instance g at the origin, just use
g.transformation = Geom::Transformation.new If you have a state before some transformations are made to the instance, you can save the state with (clone is important) tr0 = g.transformation.clone Then, later, you can resume this state with g.transformation = tr0 Note that the transformation of an instance corresponding to g.transformation is always in the context of its parent.
5 posts
• Page 1 of 1
