QuadTrees generate too many triangles

Started by
3 comments, last by CamelFly 22 years, 2 months ago
Hi I''m making quadtrees for optimizing terrain following in my game. My implementation seems to work alright, I pre-generate the quadtrees by the way, but it generates huge amounts of triangles when set to higher depth limits. I would think that you could increase the depth of the quad tree to reduce the number of triangles in a quad to a minimum of two, but it does not want to work that way. I spilt each cell at the vertex found closest to the center to reduce extra splitting wich seems to help at lower depths but apparently does nothing at higher depths. Is this normal for quadtrees, or am i doing something wrong to make them behave like this. Source code is in Java (Readable) and availabe upon request. Thanks in advance [Insert cool signature here]
[Insert cool signature here]
Advertisement
Perhaps i should specify some more:

I would like to know when to stop splitting and even more: where to split a quad. Sometimes my child quads contains more tri''s than their parents, which kind of defeats the trees purpose.

[Insert cool signature here]
[Insert cool signature here]
you dont need to "split" the tris.

if this is for a collision system then just place a
reference of the tri in all the grids its in.
if its for your rendering system only place the
triangle into one of the grids.
Alright. i thought that division planes actually should divide something.

Now it looks a lot better. thanks!

[Insert cool signature here]
[Insert cool signature here]
yeah, you should only ever _need_ to subdivide a surface or mesh
for one of three things....

lighting
or
programatically generated levels of detail
or
some cool special effect that would benefit from it


This topic is closed to new replies.

Advertisement