Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Water article

This topic is 6877 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wrote a small program that creates the waves in C++. The part for the waves looks like this:


void CalculateWaves (void)
short tmp_value;

for (y = 2; y < 198; y++)
for (x = 2; x < 198; x++)
tmp_value = ( WaveMap[CT][x-1][y] +
WaveMap[CT][x-2][y] +
WaveMap[CT][x+1][y] +
WaveMap[CT][x+2][y] +
WaveMap[CT][x][y-1] +
WaveMap[CT][x][y-2] +
WaveMap[CT][x][y+1] +
WaveMap[CT][x][y+2] +
WaveMap[CT][x-1][y-1] +
WaveMap[CT][x+1][y-1] +
WaveMap[CT][x-1][y+1] +
) / 6 - WaveMap[NW][x][y];
tmp_value = tmp_value / 1.1;
WaveMap [NW][x][y] = tmp_value;
char old_ct = CT; // CT und NW vertauschen
CT = NW;
NW = old_ct;

[This message has been edited by Melo (edited November 25, 1999).]

Share this post

Link to post
Share on other sites
Could someone plz "translate" the water article to C/C++? it's written in Pascal (i think) and i dont know that...
I would be gratefull!

Share this post

Link to post
Share on other sites
Thanx! but i still need some help!
How are the wavetable defined?
How do you make it in to a bitmap
(in allegro plz...)

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!