Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
599 views
in Technique[技术] by (71.8m points)

opengl es - How do I make a water effect view with openGLES on the iPhone?

I found this vid: http://www.youtube.com/watch?v=eVi6ThY3LRs I wonder if that's some kind of standard effect of openGLES. I'm pretty sure it is, since I have seen this pretty often. KoiPond uses it, DuckDuckDuck uses it. A lot of games use it. They're not all astronauts. They're normal programmers ;) So how is this done? Is there any tutorial for this on the web?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For an old example have a look at the 'distort' example. Note that this is a thing created back in 1992 (just looked in distort.c).

Awesome program that causes ripples in the image wherever the mouse button is pressed. Another mode of the program acts like a sheet of rubber and can be pulled by dragging the mouse.

I managed to compile the example on my mac.

  • Rename all #include <GL/glut.h> to #include <GLUT/glut.h>
  • Add a usleep(33*1000); in the idle() function
  • Rename the file ripple_precalc.c to ripple_precalc.c.org (or just rm it)
  • Compile with "cc *.c -framework GLUT -framework OpenGL" will create an a.out

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...