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 › Re: Image texture --- new to processing
Page Index Toggle Pages: 1
Re: Image texture --- new to processing (Read 922 times)
Re: Image texture --- new to processing
Oct 15th, 2009, 1:14am
 
so whats the problem with using texture()? http://processing.org/reference/texture_.html
Sure you can create basic shapes, especially rects between beginShape, endShape.

Re: Image texture --- new to processing
Reply #1 - Oct 15th, 2009, 8:05am
 
and in regards to an ellipse?
Re: Image texture --- new to processing
Reply #2 - Oct 15th, 2009, 8:32am
 
Did you remove the original question  Not very helpful if you actually want people to give you an answer...

For what it's worth I'm not convinced you can use basic shapes with texture.  Texture only works with the 3D renderer and from what I can tell the basic shapes are 2D only, which seems like an inherent incompatibility.

Depending on your use-case you might take the sprite approach.  Otherwise you'll probably have to get to grips with drawing in code...
Re: Image texture --- new to processing
Reply #3 - Oct 15th, 2009, 8:57am
 
I did delete the post by mistake, sorry.
I'm coming to grips with this problem. I may try to use a bezier circle approach, but overall the problem of ellipses/circles and textures seems a bit silly to a newcomer.
Re: Image texture --- new to processing
Reply #4 - Oct 15th, 2009, 9:14am
 
Hmm...  I guess it depends on your experience in other languages.  I'm pretty sure texture-mapping is a rather non-trivial problem and a lot goes on under-the-hood to map a texture onto a shape (bearing in mind you're also able to set UV mapping coordinates).

Another possible alternative might be to use the shape as an alpha mask; though that may not be any simpler as I think you'd need to convert the shape to a PImage...

TBH you're almost certainly have to use vertices/curves at some point so it's worth taking that route.
Re: Image texture --- new to processing
Reply #5 - Oct 15th, 2009, 9:16am
 
Quote:
I'm not convinced you can use basic shapes with texture.  Texture only works with the 3D renderer

Well, it sure isn't implemented in JAVA2D, P2D might support it but only for polygons (if I haven't read code too fast) and I suppose it is fully supported only on 3D indeed.

For any arbitrary shape in 2D, including text, you can use the method I show in Re: fill shape with pattern.
Page Index Toggle Pages: 1