PDA

View Full Version : Heightmap - Which area is visible for camera?



ProfEich
10-11-2003, 03:02 AM
Hi!

I have a heightmap and a camera which can zoom and scroll over it. (Like in Warcraft III or Ragnarök Online, if you know)

Now I like to know the area which is visible to the camera. Would be good to know because I wouldn't have to draw the other parts of the heightmaps (and trees, ...)

Thx 4 every help http://www.opengl.org/discussion_boards/ubb/smile.gif

nickcartwright
10-11-2003, 04:07 AM
For a start you can get rid of everything behind the camera...

azcoder
10-11-2003, 08:20 AM
You only need to draw what is in your viewing frustum, which is determined by:
your camera position, which way it is facing, it's field-of-view, and the near and far clipping planes,etc..

Do a google search for view frustum clipping.

Happy coding

starboarder2001
10-11-2003, 09:35 PM
quadtrees and octrees are also something you may look into.

[This message has been edited by starboarder2001 (edited 10-11-2003).]

Miguel_dup1
10-13-2003, 07:16 PM
For this kind of work, you have frustum culling... I have a question though... Are doing brute force on your heightmap, or you are using roam or something of that nature?

The reason is because you must be able to cull different portion of your space...

As someone suggested, quadtrees and octrees... What these two big words do is simply partition space into managable portion that allow for quickly deciding who is in your camera and who is not...

In my terrain engine I use sphere culling... It is very simple and does not require much mathematics are compared to many popular culling methods...

But then again, we fall back to what it is you are using to partition your space, if you are at all...

Miguel


Originally posted by ProfEich:
Hi!

I have a heightmap and a camera which can zoom and scroll over it. (Like in Warcraft III or Ragnarök Online, if you know)

Now I like to know the area which is visible to the camera. Would be good to know because I wouldn't have to draw the other parts of the heightmaps (and trees, ...)

Thx 4 every help http://www.opengl.org/discussion_boards/ubb/smile.gif