Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#Actualscniton

Posted 28 March 2013 - 02:15 AM

I will outline a method I used in a similar situation, though in my case:
- The camera/projection was not constrained: it could rotate in all 3 axes.
- The tiles corresponded to a height map terrain.

1. Obtain a world-space representation of view frustum either by computing it directly with view&projection data or extracting it from a view&projection matrix.


2. Clip the segments that join the near plane to the far plane against a plane representing the minimum height of the tiles.

3. Discard the height component of the end points of the clipped segments (i.e. project the end points onto a 2d plane.)

4. With the above 2D points you can do the following interesting things:
- Compute the 2D AABB which contains the visible tiles.
- Compute a 2D convex hull containing the visible tiles.
- From the convex hull compute a minimum 2D OBB of the visible tiles.

In your case you will only want the 2D AABB and you will want to "round up" to integer extents so that you include all the edge tiles.


If the camera is constrained as you have described then the 2D AABB, 2D convex hull and 2D OBB should all be identical.


#4scniton

Posted 28 March 2013 - 02:15 AM

I will outline a method I used in a similar situation, though in my case:
- The camera/projection was not constrained: it could rotate in all 3 axes.
- The tiles corresponded to a height map terrain.

1. Obtain a world-space representation of view frustum either by: computing it directly with view&projection data, extracting it from a view&projection matrix.


2. Clip the segments that join the near plane to the far plane against a plane representing the minimum height of the tiles.

3. Discard the height component of the end points of the clipped segments (i.e. project the end points onto a 2d plane.)

4. With the above 2D points you can do the following interesting things:
- Compute the 2D AABB which contains the visible tiles.
- Compute a 2D convex hull containing the visible tiles.
- From the convex hull compute a minimum 2D OBB of the visible tiles.

In your case you will only want the 2D AABB and you will want to "round up" to integer extents so that you include all the edge tiles.


If the camera is constrained as you have described then the 2D AABB, 2D convex hull and 2D OBB should all be identical.


#3scniton

Posted 28 March 2013 - 02:09 AM

I will outline a method I used in a similar situation, though in my case:
- The camera/projection was not constrained: it could rotate in all 3 axes.
- The tiles corresponded to a height map terrain.

1. Obtain a world-space representation of view frustum either by: computing it directly with view data, extracting it from a view matrix.


2. Clip the segments that join the near plane to the far plane against a plane representing the minimum height of the tiles.

3. Discard the height component of the end points of the clipped segments (i.e. project the end points onto a 2d plane.)

4. With the above 2D points you can do the following interesting things:
- Compute the 2D AABB which contains the visible tiles.
- Compute a 2D convex hull containing the visible tiles.
- From the convex hull compute a minimum 2D OBB of the visible tiles.

In your case you will only want the 2D AABB and you will want to "round up" to integer extents so that you include all the edge tiles.


If the camera is constrained as you have described then the 2D AABB, 2D convex hull and 2D OBB should all be identical.


#2scniton

Posted 28 March 2013 - 02:05 AM

I will outline a method I used in a similar situation, though in my case:
- The camera/projection was not constrained: it could rotate in all 3 axes.
- The tiles corresponded to a height map terrain.

1. Obtain a world-space representation of view frustum either by: computing it directly with view data, extracting it from a view matrix.


2. Clip the segments that join the near plane to the far plane against a plane representing the minimum height of the tiles.

3. Discard the height component of the end points of the clipped segments (i.e. project the end points onto a 2d plane.)

4. With the above 2D points you can do the following interesting things:
- Compute the 2D AABB which contains the visible tiles.
- Compute a 2D convex hull containing the visible tiles.
- From the convex hull compute a minimum 2D OBB of the visible tiles.

In your case you will only want the 2D AABB and you will want to "round up" to integer extents so that you include all the edge tiles.

If all your tiles are perfectly flat this method is way too conservative.


#1scniton

Posted 28 March 2013 - 01:59 AM

I will outline a method I used in a similar situation, though in my case:
- The camera/projection was not constrained: it could rotate in all 3 axes.
- The tiles corresponded to a height map terrain.

1. Obtain world-space representation of view frustum either by: computing it directly with view data, extracting it from a view matrix.


2. Clip the segments that join the near plane to the far plane against a plane representing the minimum height of the tiles.

3. Discard the height component of the end points of the clipped segments (i.e. project the end points onto a 2d plane.)

4. With the above 2D points you can do the following interesting things:
- Compute the 2D AABB which contains the visible tiles.
- Compute a 2D convex hull containing the visible tiles.
- From the convex hull compute a minimum 2D OBB of the visible tiles.

In your case you will only want the 2D AABB and you will want to "round up" to integer extents so that you include all the edge tiles.

If all your tiles are perfectly flat this method is way too conservative.


PARTNERS