
| main page | gallery | rationale | contact |
|
a cool OpenGL effect
Introduction I wrote this neat effect in the midst of rewriting some of the OpenGL code from modtanks. I was just kind of playing around with heightmaps, GL_TRIANGLE_STRIPS, and sine curves, and this is the end result. There's a couple strange things thrown in with the drawing code: a pseudo object-oriented system using C structures (similar to Quake), and the beginnings of a generic DirectInput wrapper. What Was Difficult? Not much, I just recycled my old code and added some new drawing code. I recall having some trouble getting the triangle strips to draw properly due to vertex ordering. Here's the function that actually draws the cool wavy thing, which I apparently called "DrawBoxes." Be sure to note that you can specify per-vertex coloring and translucency and OpenGL will blend and draw polygons correctly, which is how part of the effect was achieved.
What you need to compile & run this Well, for Windows, I'd recommend Microsoft Visual C++ 6.0 or greater, since that's exactly the tool I used to develop this project. You'll also need the DirectX 7.0a or later SDK, currently available from: http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp Controls
| ||||||||||||||
![]()
Last updated: 2003.03.03 by falger@calpoly.edu