Lesson47:b_insideLoop(wave_movement)?ErrorReport("NeHe"):AskForum("GameDev.net")
Hi all. Last night i read another great tutorial form NeHe and I confused about "wave_movement" variable. I belive that it should not be incremented in the for loop and i tried to increment it after the loops and it worked. However, I also believe that if it is inside the for loop we should see some sharp differences in the output. Because, if it is the case then we are saying that:
function calculateAllVertexPos(int wave_movement, float *wave)
{...
IN.position.y = ( sin(IN.wave.x + (IN.position.x / 5.0) )+.....
...}
main(){
for(all Z values)
for(all X valuse)
calculateAllVertexPos(wave_movement, wave);
glVertex3f(wave[x], wave[y], wave[z]);
glVertex3f(wave[x+1], wave[y], wave[z]);
wave_movement+=0.00001f;
} } }
I hope you understand that we are Recalculating wave[y] values for every vertex.
Code would be correct if and only if CG program is called everytime glVertex*() function is called. But if this is the case then it should not work if I moved "wave_movement+=0.00001f;" statement to outside of the loops.
By the way, When our CG program is called in the main program ?
I hope someone will clear up my mind, thank you for even reading this.
myIQ>0.003?false:false
Error:undefined symbol "myIQ"
myIQ>0.003?false:falseError:undefined symbol "myIQ"
Your subject is way to long. You''re messing up my Active topics page!
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement