如何在 iPhone 上使用 openGLES 制作水效果视图? [英] How do I make a water effect view with openGLES on the iPhone?

查看:15
本文介绍了如何在 iPhone 上使用 openGLES 制作水效果视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了这个视频:http://www.youtube.com/watch?v=eVi6ThY3LRs我想知道这是否是 openGLES 的某种标准效果.我很确定是这样,因为我经常看到这种情况.KoiPond 使用它,DuckDuckDuck 使用它.很多游戏都使用它.他们不都是宇航员.他们是普通的程序员 ;) 那么这是怎么做到的呢?网上有这方面的教程吗?

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?

推荐答案

对于一个旧示例,请查看 '扭曲'的例子.请注意,这是在 1992 年创建的(仅在 distort.c 中查看).

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.

我设法在我的 mac 上编译了这个例子.

I managed to compile the example on my mac.

  • 将所有 #include <GL/glut.h> 重命名为 #include <GLUT/glut.h>
  • idle()函数中添加一个usleep(33*1000);
  • 将文件 ripple_precalc.c 重命名为 ripple_precalc.c.org(或直接 rm)
  • 使用cc *.c -framework GLUT -framework OpenGL"编译将创建一个a.out
  • 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

这篇关于如何在 iPhone 上使用 openGLES 制作水效果视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆