OpenGL ES: Doing a background distortion

Apprentice
Posts: 12
Joined: 2009.04
Post: #1
I am trying to make an application as proof of concept. I have an image, with which I want to fill the screen. When the user clicks somewhere, I want the image to be distorted in that spot, like if it was on a net of some short (that spot of the image going forwards and backwards).

Does anyone have any idea how can I make this effect?
Quote this message in a reply
Member
Posts: 166
Joined: 2009.04
Post: #2
soulstorm Wrote:I am trying to make an application as proof of concept. I have an image, with which I want to fill the screen. When the user clicks somewhere, I want the image to be distorted in that spot, like if it was on a net of some short (that spot of the image going forwards and backwards).

Does anyone have any idea how can I make this effect?

You need to create a 2d grid composed of triangles and then simply when the user clicks on the scren, map screen coordinates to the grid coordinates.
Once you have your vertex , simply run a simple algorithm to do sin/cos based distortion which you can then confine to a specific radius within the grid ( and vary wav's amplitude based on the distance from the original vertex)
Quote this message in a reply
Apprentice
Posts: 12
Joined: 2009.04
Post: #3
Thanks a lot for your answer. I will try to do that, and I will get back to you with my progress. I am sure I will need some help for this as it will require a lot of texture coordinate calculations on my part...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL - how to draw background image? SDyer777 1 7,046 Mar 9, 2009 11:17 AM
Last Post: AnotherJake
  OpenGL ES Scrolling Background abdm436 5 5,614 Oct 21, 2008 09:30 AM
Last Post: AnotherJake