Jump to content
  • Advertisement
Sign in to follow this  
Twist wish

Problems with Quadtrees

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

I'm trying to use a simple quadtree with a program that reads a heightmap a let the user moves with keyboard and mouse but I have a problem. I'm using OpenGL and VC++ but I'm prefer plain C than C++ (maybe later I would try put some stuff in classes). If I draw some nodes directly it works but when I want to restrict the nodes with frustum culling there are some that appear later that it's supposed. To do the frustum culling I'm using this from Mark Morley and I'm implemmented the quadtrees on my own. There is any way to know if the frustum planes are right after the extraccion? I hope someone has some idea about what can be wrong, at least a hint because I have read the code so many hours without knowing what can be. I could post some code if you explain me how to put it in some nice-scrolling-window :) /* As always forgive or better forget my english */ /* I promise I will learn! */

Share this post


Link to post
Share on other sites
Advertisement
Well after some resting time and a return to the code I've found an stupid error (arrrrrrgh :) ).

Now I have another question. By now I don't have any objects only terrain but the quadtree sometimes don't draw nodes that need to be drawn. I find that you can be "seeing a node but not his corners"
And the question is: What can you suggest to do? I have to change the condition of a point being in negative half-space to being in negative half-space AND far from a plane of what?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you should look up on google something like "AABB in frustum"

you don't want to be asking the frustum if points of your AABBs are in the frustum, that wont work as you can see.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
you should look up on google something like "AABB in frustum"

you don't want to be asking the frustum if points of your AABBs are in the frustum, that wont work as you can see.


Thanks. I have thought so much time in quads that I haven't thought about nodes as boxes :( .

I found that the same article that I've used before talk about culling cubes so I adapt it to my case. It works pretty well, BUT sometimes I oversee a "phantom" node that appear a bit later than supposed. Could it be because precision or something like that?

Thanks in advance.


/* forgive my english... */



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!