
284 18. Terrain Geometry—LOD Adapting Concentric Rings
18.6 Moving the Grid
To keep the grid centered at the camera it needs to be oset by the camera position (instan-
taneously). It is also required that the grid be positioned in steps of one cell size in order
to avoid popping. e cell size is the size of one cell on the grid. An easy way to achieve
this isto transform the camera position into gridspace and shi the grid position by the
rounded camera position. invTransformPosition is the inverse of transformPo-
sition from Section 18.3; it transforms a worldspace position to gridspace (Listing 18.6).
Listing 18.6 Moving the grid position t ...