Jump to content
  • Advertisement
Sign in to follow this  
schupf

Simple grid good structure?

This topic is 2531 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

Hi!

I have a little 3D game world with a 45 Degree bird eye view camera (kinda like the SNES Zelda games: http://nocjoz.de/blog/wp-content/uploads/alinktothepast.jpg ). But my worls if fully 3D.

The world is relatively small (maybe 10 screens) and I have a lot of picking (the user can select trees, stones etc).
Actually I wanted to use a simple 2D Grid for collision detection and an AABB quadtree for culling. But the more I think about it, the more I tend to use the 2D grid for everything (collision, culling and picking). Since I need it for collision I have it anyway and picking can also be done in the 2D grid (all I need to do is checking which cells are intersected by the picking ray. Kinda like bresenham I guess).

Do you think its a good idea for my game to skip the AABB quadtree all together and use a 2D grid for all tasks (frustum culling, picking and collision)? If yes: Do you know an algorithm/paper that describes how I can detect the cells my ray is intersection? How could I do frustum culling with my grid in a good way? I thought about projecting the corner points of the camera frustum into the grid and then determine which cells are intersected by the 2D frustum. Good/bad idea?

Share this post


Link to post
Share on other sites
Advertisement
It's not an unreasonable approach at all.

" How could I do frustum culling with my grid in a good way? I thought about projecting the corner points of the camera frustum into the grid and then determine which cells are intersected by the 2D frustum. Good/bad idea?"

Depends on your camera angle; it may select a lot of cells in the distance. But generally, doesn't seem like a bad plan.

One of the crucial decisions is what size to make your grid. Too big and you'll have too much stuff within the squares to sort out. Too small and you spend too much time doing those frustum/square intersection tests. This is the problem that a full quadtree is designed to solve. If you can get a good compromise between those sizes for your particular application, no reason why it won't be a good solution.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!