Jump to content
  • Advertisement
Sign in to follow this  
phishtree

Boxes in Frustum

This topic is 2859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I have a infinite grid in 2D space. I also have a camera position and camera field-of-view (FOV) angle. I already know how to determine is a grid is inside the FOV.

The problem is that I am trying to collect all the grid points that exist within the FOV that is also less than X-distance away from the camera.

Here is an image to illustrate the problem:
Problem

Things that are given:
1. Camera position (and which grid it is in), it's facing diection as well as its FOV
2. Max distance a grid can be away from the camera

I can do a brute force method but it just seems so computationally inefficient. Anyone have any good ideas? I appreciate any help.

[Edited by - phishtree on August 24, 2010 6:56:30 PM]

Share this post


Link to post
Share on other sites
Advertisement
This is actually much simpler than it first seems. I recommend reading this:
Rasterization on Larrabee. It covers the basic idea of finding which tiles are on a side of a line. They use a 4x4 grid, but you'll want to use a quadtree with look-up tables.

If that article confuses you then I'll explain a very similar method that isn't as extensively optimized:

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!