#### Archived

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

# Water article

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

## Recommended Posts

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).]

##### 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 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...)
Thanx!

1. 1
2. 2
3. 3
Rutin
23
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633654
• Total Posts
3013168
×