# Toroidal addressing in terrain rendering

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, Some days ago, I found a paper from Hugues Hoppe (Geometry clipmaps: Terrain rendering using nested regular grids) But I got stuck with something my brain don't want to understand : "Toroidal Adressing" ... I understand the idea (modulo addressing) but in this paper and the other related ones found in the reference, I didn't find any usefull information on a practical implementation. So, if someone has an idea on how this thing works, he(she) would be nice to explain it to me ^__^ .:: Paic Citron ::.

##### Share on other sites
He actually explains it right where he defines it (though it took me a few times reading his paper to notice):

"...with 2D wraparound addressing using mod operations on x and y"

So, basically, you take the size of your clipmap buffer (sizeOfClipmap), and enter coordinates into the clipmap as such:

xClip = xWorld % sizeOfClipmapyClip = yWorld % sizeOfClipmap

It's really as simple as that :)

##### Share on other sites
I understand now : I'm just dumb ^^ I tried to understand starting from a wrong example, but now I understand well. I think I also need to store the coordinates of the clipmap's center to now where the clip region is, because of the modulo.

Thx again ^^

.:: Paic Citron ::.