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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…