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 › Strategy for applying a gradient to a 2D shape
Page Index Toggle Pages: 1
Strategy for applying a gradient to a 2D shape? (Read 667 times)
Strategy for applying a gradient to a 2D shape?
Nov 17th, 2009, 6:39am
 
I have some various 2D shapes with multiple curved vertices that I'd like to apply a simple light-to-dark gradient fill over an axis.  I've seen the examples using set() but this seems onerous and probably somewhat difficult with the shapes I'm using.  I'm wondering if there is a simpler way to accomplish this with a transparent PNG overlay on the shapes? Or perhaps an OpenGL command?  Something else I'm not thinking of? Any pointers appreciated!

Thanks,
Henry
Re: Strategy for applying a gradient to a 2D shape?
Reply #1 - Nov 17th, 2009, 7:08am
 
PhiLho posted a good example of how to fill shapes and text with a texture, this could be also applied to any other drawing and texture as a gradient for example. But even if the shape changes its orientation, the texture doesnt

http://processing.org/discourse/yabb2/?num=1229687224
Re: Strategy for applying a gradient to a 2D shape?
Reply #2 - Nov 17th, 2009, 7:32am
 
Thanks, Cedric - I'll give it a shot
Page Index Toggle Pages: 1