OpenGL ES: Doing a background distortion
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?
Does anyone have any idea how can I make this effect?
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)
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...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL - how to draw background image? | SDyer777 | 1 | 5,925 |
Mar 9, 2009 11:17 AM Last Post: AnotherJake |
|
| OpenGL ES Scrolling Background | abdm436 | 5 | 5,139 |
Oct 21, 2008 09:30 AM Last Post: AnotherJake |
|

