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.
Page Index Toggle Pages: 1
Shape mapping (Read 937 times)
Shape mapping
Oct 1st, 2009, 4:58am
 
Hi, I am new to this... sorry if I'm using the wrong terminology...
I'm trying to map artwork on letters (thinks of a letter covered in ivy).
Is there a ready made solution to this?

I am thinking about an algorithm checking whether the center of the ornament falls within the boundaries of the letter, but it gets tricky when you have a compound shape like the letter O for example. Any advice greatly appreciated.
Re: Shape mapping
Reply #1 - Oct 1st, 2009, 6:07am
 
you can use get() http://processing.org/reference/get_.html
to check for the color at a specific point. Lets say youve got an image like this : http://is.gd/3Qouh
you do something like:  if(get(x,y)==0) then draw ivy, or whatever you want. I have used this method in the past to grow some stuff on text :
http://is.gd/3QoMN
Re: Shape mapping
Reply #2 - Oct 1st, 2009, 7:09am
 
Sounds good, I will try that. Thanks for the tip!
Re: Shape mapping
Reply #3 - Oct 1st, 2009, 8:01am
 
See also Re: fill shape with pattern
You might want to draw the letters one by one by adjusting the position of the pattern, but that's a start.
Re: Shape mapping
Reply #4 - Oct 1st, 2009, 8:12am
 
this post was new to me... thats a nice way of fillin a shape with a texture.
Page Index Toggle Pages: 1