.index.
.daily url feed.
.my daily links.
.useful programs.
.photo album.
.nemi translated.
.web log.
.OpenGL.
.PGP Pubkey.
.cv.doc.

Exit Strategies:

IRL
Iain Davidson
Andy Grepus
Bufferine
Adam H.
Mea

IRC
Joichi Ito
Suw Charman
ioerror
Catspaw

Blogodrome
SionPhoto
The Old New Thing
The Daily WTF

Related sites:
SnapTranslate
Tab Crab
DealDoubler

Valid RSS feed. GeoURL
Ourmedia

Here are some simple OpenGL demos that I wrote while bored. I wanted to get a decent wave modelled. The files below give you a view of the idea as it progressed. You'll need to have this .dll file in the same directory as the files when you run them, or they won't work. As this was a work in progress, source exists only for the final version. I used MS Visual Studio and the GLUT library.

This was the first one I got working. I stayed with just simple dots to mimic the surface until I was happy with the general motion of the wave. There's also some fogging in the z-axis, to give a feeling of depth. Use the spacebar to start/stop the wave motion.

dots3d.exe

In the second version, I played a bit with the general look of the wave, moved the viewpoint, added more rows of dots and accentuated the fog effect. Use the spacebar to start/stop the wave motion.

dots3d2.exe

Third version. More twiddling with viewpoint and fogging. Now you can see the entire wavelength. in-view. Use the spacebar to start/stop the wave motion.

dots3d3.exe

The fourth version gives the user the ability to add and remove rows of dots from the wave. Use the z and x keys to add and remove dots. Use the spacebar to start/stop the wave motion.

dots3d4.exe

I realised the wave I had created did not resemble real life properly - the dots should be moving from side to side in the plane of the wave motion as well as up and down. I added the.required motion, but it was out of sync with the vertical motion, producing this rather appealing snake-like motion along the direction of the wave crests. Not quite what I was after though. Use the z and x keys to add and remove dots.

dots3d5.exe

Version six. The wave is now behaving a little better, however the dots are describing ellipses (which only happens near shore). More twiddling is needed. Use the z and x keys to add and remove dots.

dots3d6.exe

In the seventh version, the dots now describe circles. The result is that the wave is looking pretty realistic now. I'm happy with the motion now, so it's time to figure out how to texture the moving wave. Use the z and x keys to add and remove dots.

dots3d7.exe

Version eight didn't work. I tried to implement a fancy texturing form called GL_TRIANGLE_STRIP in which you save vertices by reusing them. I soon realised it was more trouble than it was worth and so I went for a simpler solution.

Version nine. The texturing works, yay! :) There's no interactivity in this version though - time for the next version.

dots3d9.exe

Version ten - the final version. The z and x keys change the wavelength, "," and "." change the amount of light on the wave and the p key toggles the texturing. The source for this little demo is here.

dots3d10.exe

Back to Top