2

I am trying to develop a Game in android for that i need to have a ocean wave effect.I am using OpenGL ES 1.0 for the development.When i searched for the implementation examples and logic i have come across lots of mathematical calculation and all.something like calculating sum of sine function with specific amplitude and frequency and all (http://http.developer.nvidia.com/GPUGems/gpugems_ch01.html)

Sine Wave equation:\

W1=A1*sin(D1.(x,y)*w1+t*q1)

A1=amplitude of 1st wave
D1=direction of 1st wave
w1=frequency of 1st wave
t=time 
q1=phase constant q=speed*2P/Length.

taking the sum of this equation will give the surface,

Surfce equation:

H(x,y,t)=W1+W2+W3....

and there are equations to calculate normal

So guys , how can i use these equations to calculate values for vertex array and normal array to render the ocean surface in my application...i would be most grateful if you people can give a code example or any help...

4

0 回答 0