Sign in to follow this  
Twist wish

Problems with Quadtrees

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this