Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: wrap around terrain

  1. #1
    Intern Newbie
    Join Date
    Mar 2002
    Location
    pittsburgh
    Posts
    44

    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

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,407

    Re: wrap around terrain

    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

  3. #3
    Intern Contributor
    Join Date
    Jun 2002
    Location
    Alamogordo, NM USA
    Posts
    67

    Re: wrap around terrain

    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.
    Japanese Proverb: "Talk about things of tomorrow and the mice in the ceiling laugh."

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,407

    Re: wrap around terrain

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

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

  5. #5
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    477

    Re: wrap around terrain

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •