|
osgOcean的FFToceanSurface类里面有这么几个变量:
unsigned int _tileSize; /**< Size of FFT grid 2^n ie 128,64,32 etc. */
unsigned int _tileResolution; /**< Size of tile in world width/height. */
unsigned int _numTiles; /**< Number of tiles on width/height. */
unsigned int _totalPoints; /**< Total number of points on width/height. */
float _pointSpacing; /**< Spacing between points in real world. */
按我的理解就是_tileSize是整个海面网格大小,必须为2的次方数。
而其中每一块由一个tile组成,就像下面这样:
但是他给的例子里面的生成海面方法中:_oceanSurface = new osgOcean::FFTOceanSurface( 64, 256, 17,
windDirection, windSpeed, depth, reflectionDamping, waveScale, isChoppy, choppyFactor, 10.f, 256 );
第一个就是_tilesize=64,然后_tileResolution=256, _numTiles=17;
_totalPoints和_pointSpace由构造函数直接算出:
_totalPoints=_tileSize * _numTiles + 1=1089
_pointSpace=_tileResolution / _tileSize=4.
那么,我就想知道17个tiles是怎么布满64的Grid?还是我理解错了。
还有为什么总的点数是_tileSize * _numTiles + 1这么算? 那么每个tile有几点啊??
望帮忙啊!
|
|