Results 1 to 3 of 3

Thread: Tiled Terain

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2007
    Location
    Lenexa, KS
    Posts
    7

    Tiled Terain

    Hello,

    I am trying to make a small overmap engine. I would be using a type of heightmap that dictates the height as well as texture to use.

    I want to render it in such a way that I can control what part of the map is seen, so that the map doesn't seem to have any edges, but seems to loop. To do this, I need to know what is visible on the screen (the width and height visible on the screen)and to be able to render what should be seen where it should be seen.

    The question then is how can I tell just how much is visible on the screen when I'm not using Ortho? I'm used to exact placement that you get with ortho. But I want/need a depth look that you get with an angled camera.

    If there were some way to accomplish this in ortho mode that would be much easier for me. Ether way would work though.

    Any suggestions, code, tutorials, books, etc?

    Thanks!
    Micah

  2. #2
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,107

    Re: Tiled Terain

    Look for "frustum culling".
    Simply assume your entire map is a box. Later you can split your map into smaller sectors to get better performance. Smallest box should have at least few hundred polygons, but few thousands polygons should be optimal, I guess.

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Tiled Terain

    I would try gluUnproject for each corner of the screen, then with a line going from camera to unprojected point, intersect your terrain (roughly, with altitude 0 plane for example) : it will give you max/min 2D coordinates on your height field. Enlarge a bit the selected rectangle to be sure.
    http://www.opengl.org/documentation/...unproject.html

Similar Threads

  1. Replies: 7
    Last Post: 07-02-2013, 05:14 PM
  2. Tiled Minimap
    By wesFR in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 03-03-2010, 03:35 PM
  3. Tiled Map
    By KonoM in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-05-2010, 05:52 PM
  4. Tiled textures?
    By weebull in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-06-2003, 01:08 AM
  5. tiled texture
    By mishuk in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 01-11-2003, 11:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean