We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Geomerative - how to reset transform
Page Index Toggle Pages: 1
Geomerative - how to reset transform (Read 1121 times)
Geomerative - how to reset transform
Apr 16th, 2010, 8:17am
 
Geomerative appears to apply transforms (translate/scale/rotate/skew) directly to the underlying vertex coordinates, rather than maintaining the original coords and the accumulated matrix.  So, there doesn't appear to be any (convenient) way to "reset the matrix" back to identity and put all the x/y's back where they came from originally.

Take tutorial #5 for example, where rotation is accumulated on the first letter.  Is there any way to reset that rotation?  (short of manually un-transforming in reverse after each frame, which won't really work due to accumulated errors)

Or is the expected approach to make a copy of original geometry, apply transform to the copy, use the copy as desired, then discard the copy?  (thus leaving the original untransformed)  I suppose that works, but is a bit heavy-handed.  Am I missing some "simpler" approach?

Thx,
Re: Geomerative - how to reset transform
Reply #1 - Apr 16th, 2010, 8:48am
 
Hi,

I'm afraid maintaining the copy of the original is the way to go.  You're not the first to ask about this, and I have been thinking about implementing it.  But it is quite a bit of work, and I don't have that much time right now.  Maybe in the future.

Sorry for that,
ricard
Re: Geomerative - how to reset transform
Reply #2 - Apr 16th, 2010, 8:55am
 
Oh! forgot to say that making the copy is a one-liner:

Code:

RShape copy = new RShape(orignal);


But don't worry, I do understand that this is not optimal from a computational point of view, and that a better approach would be to keep the accumulated transformation on the shape.
Re: Geomerative - how to reset transform
Reply #3 - Apr 16th, 2010, 10:02am
 
Thanks Ricard, understood, and no apologies necessary (thx for the library just the same), I really just wanted to make sure I hadn't "missed" something that offered another approach.
Page Index Toggle Pages: 1