Dear Kim,
         I have done some research on the paper "Simulating Ocean Water" (the 
paper you provide for me several days ago). And the third part -- Practical 
Ocean Wave Algorthms ---- is an attriactive algorthms.
         However , the corresponding codes in OSGOcean class -- FFTSimualtion-- 
is not in accord with origianl paper that presented. In the function "void 
FFTSimulation::Implementation::computeHeights( osg::FloatArray* waveheights ) 
const" , the DFT algorithm is done for wave height simulation.  But the final 
lines in this member function really confused me a lot :
                const float signs[2] = { 1.f, -1.f };
                for(int y = 0; y < _N; ++y)
                {
                  for(int x = 0; x < _N; ++x )
                 {
                    waveheights->at(y*_N+x) = _realData0[x*_N+y][0] * signs[(x 
+ y) & 1];
                  }
              }
          So , could you please explain to me why "sings[(x+y)&1]" was used 
here? In addation , why noly the "_realData0[x*_N+y][0]" used for the wave 
height computation?  To some extent , the codes here is not that corresponding 
to the function(19) presented in the third part of the origianl paper.   I have 
taken several day to thought about it , but in vain. Therfore , I will feel 
appreciate if you can give me a resonable reply or provide some relevant 
materials to me.
          I am looking forward to your reply.
                                                                                
                               Sincerely Yours,
                                                                                
                               Zhang Mi
    School of Remote Sensing  and  Information Engineering , Wuhan Universiy , 
Hubei Provinence , China.
                                                  
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to