PDA

View Full Version : wrap around terrain



incus
09-17-2002, 09:18 AM
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

zed
09-17-2002, 09:51 AM
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

Jeffry J Brickley
09-17-2002, 10:23 AM
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. http://www.opengl.org/discussion_boards/ubb/smile.gif

zed
09-17-2002, 07:21 PM
youre correct ( + i only just done this yesterday as well http://www.opengl.org/discussion_boards/ubb/smile.gif doh)

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

zen
09-18-2002, 02:53 AM
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.