wrap around terrain

i have created a heightfield terrain and now want to make it into a wrap around terrain so that it will be “infinate”. any ideas on how i do this? Incus

second non gl question ive answered.
the borders will have to math up of course or else visual problems will occur.
either warp the objects/camera to the other side when it ‘leaves’ the area or use cameradraw.x = camera.x % terrain_width.
the first method is better

Actually I would do it one different, but I am the oddball of the bunch here. I would not “draw” the heightfield as an object per se. I would build a bin-tree or other tree structure (see algorithms at vterrain.org) based on the current eye view. But I would have the wrap-around math in the height lookup to build the tree. This way you always build a square terrain with you in the center of it based on the wraparound heightfield.

Of course, you ask me what time it is, I will probably tell you how to build a clock.

youre correct ( + i only just done this yesterday as well doh)

u will need to translate each block of the landscape into ‘cameraspace’

btw there’s a gamasutra article on split-only ROAM by Bryan Turner which uses terrain wrapping.Have a look.Besides split-only ROAM is a pretty good choice for a game terrain engine anyway.