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 & HelpSyntax Questions › pushMatrix() limits
Page Index Toggle Pages: 1
pushMatrix() limits? (Read 590 times)
pushMatrix() limits?
Mar 14th, 2008, 9:34pm
 
Hi,

I'm trying to adapt the LSystem class used in the Pentigree example to create a fractal plant based on this example:
http://en.wikipedia.org/wiki/L-system#Example_8:_Fractal_plant

Problem is, when I tried implementing these two rules, I very quickly hit the limit of the matrix stack (only 32, apparently).

Is there some way to increase the size of the matrix stack?  Or if not, is there a way I could access the current matrix so that I can store it in my own data structure, and then clear and reapply it myself later?  Building my own stack would be easy but I don't see a way to dump the matrix contents to another variable, and I'd rather not rebuild all of the transform and rotation functions.
Re: pushMatrix() limits?
Reply #1 - Mar 16th, 2008, 6:29pm
 
that's exactly the motivation behind this hack:
http://www.processinghacks.com/hacks/deepmatrixstack
..and it works in exactly the way you've imagined.
Re: pushMatrix() limits?
Reply #2 - Mar 17th, 2008, 12:57am
 
Awesome, thanks!
Re: pushMatrix() limits?
Reply #3 - May 12th, 2008, 3:30am
 
davbol wrote on Mar 16th, 2008, 6:29pm:
that's exactly the motivation behind this hack:
http://www.processinghacks.com/hacks/deepmatrixstack
..and it works in exactly the way you've imagined.


I'm running in to the same problem, but that link is down, and I can't seem to find that hack in the hacks section. Anybody have current info on it

Thanks.
Page Index Toggle Pages: 1