Tuesday, March 15, 2011

More Waves and Dialog Boxes

After several weeks of testing several different algorithms, I think I've finally settled on one for rendering basic waves (without the help of shaders). It's been a long road, and oddly enough, I've pretty much come back to where I started, with some minor modifications to an original idea...combined with a minor discovery. First some wave screenshots:


The new algorithm essentially checks the nearby eight vertices (as opposed to the four I was originally working with) and averages them. Also, when a waveheight initially passes over a point, it essentially starts the point "spinning" around. That angle is translated via a sine function into a value which is added to the point's height. The key discovery I made was that through this combination, I could make each vertex of the mesh simluate a dying sine wave by continually decreasing the radius value in the following equation:

y = r * sin (angle)

Basic trigonometry, yes, but in all my previous testing I ignored the r component for some unknown reason.

I've also been busy working on some 3-D dialog box improvements, seen here:


In this screenshot, I'm demostrating some basic checkboxes, a slider control, a textbox control, a button, and an image control. All on a fully rotatable, 3-D dialog box/window. The main use for this will be heads-up-displays, pop-up dialog boxes, etc. It is also fully alpha-blending enabled.

With these items nearing completion, I'm now turning the corner towards actual game design. There is one last stubborn textbox bug to squash, and after that I'll run some tests over on my Vista box. Then...it's design time!

No comments:

Post a Comment