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 › Offset pixel to distort texture/image
Page Index Toggle Pages: 1
Offset pixel to distort texture/image (Read 713 times)
Offset pixel to distort texture/image
Feb 21st, 2008, 2:00pm
 
Hello.

Since I have never done anything similar I was wondering How I could distort a texture. I thought maybe I could use the img.pixels[] array to offset each pixel depending on certain rules (for example noise values). But apparently I can only affect the color value through the pixels[] array. The Distort filters in Photoshop would propably describe best what I am looking for.
Id be glad if anyone yould give me a hint!
Re: Offset pixel to distort texture/image
Reply #1 - Feb 21st, 2008, 2:06pm
 
hi, check out http://processing.org/reference/vertex_.html, the vertex(x,y,u,v) might be what you're looking for. I normally start off with some kind of rectangular grid, and start to move nodes around to distort/warp.
Re: Offset pixel to distort texture/image
Reply #2 - Feb 21st, 2008, 2:14pm
 
oh, hwo could I oversee this. I think I could get this to work. is there any other way?
Re: Offset pixel to distort texture/image
Reply #3 - Feb 21st, 2008, 2:23pm
 
it's the easiest way i know. of course you can also cycle through pixels[] and move them arround, but you then have to interpolate the upcoming gaps between the pixels yourself. but hey, that's just what i figured, i'm pretty sure there are many other ways to distort images.
Page Index Toggle Pages: 1