Skip to Main Content
WebGL Insights
book

WebGL Insights

by Patrick Cozzi
August 2015
Intermediate to advanced content levelIntermediate to advanced
416 pages
16h 58m
English
A K Peters/CRC Press
Content preview from WebGL Insights
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 oset 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 isto 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

James L. Williams

Publisher Resources

ISBN: 9781498716079