🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Math problem in 11th lesson

Started by
0 comments, last by lc_overlord 17 years, 11 months ago
All the problem in lesson 11,line 182 if( wiggle_count = 2 ) { for( y = 0; y < 45; y++ ) { hold=points[0][y][2]; for( x = 0; x < 44; x++) { points[x][y][2] = points[x+1][y][2]; } points[44][y][2]=hold; } wiggle_count = 0; } yeah,i know,this is very important to make the wave goes on,but i am confused that,after the loop of Y,which from the 0 -> 45,how can we fresh the points[0][y][2],i think it had been taken by the points[1][y][2],that i think the inner loop of X. i put the '//' before the 'hold=points[0][y][2];' and 'points[44][y][2]=hold;',and then there was only just one wave,why? can anyone tell me how and where does NEHE refresh the points[0][y][2].
Advertisement
this line
points[x][y][2] = points[x+1][y][2];
x is 0 the first time in the x loop

'hold=points[0][y][2];' and 'points[44][y][2]=hold;' transfer the wave from one side to the other, if this is not done then the wave will die out as it goes from one end to the other.

This topic is closed to new replies.

Advertisement