Jump to content

  • Log In with Google      Sign In   
  • Create Account

Water article


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 HIND-D   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 1999 - 09:32 AM

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!



Sponsor:

#2 Melo   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 1999 - 04:10 AM

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

code:

void CalculateWaves (void)
{
WORD x;
WORD y;
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] +
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).]


#3 HIND-D   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 1999 - 09:32 AM

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





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS