-
Quadtree algo
I think I get the gist of quadtrees...but I'm not sure about certain things.
I'm not sure when to stop in the tree.
In the example I've shown here I've already discarded possible hundreds or even thousands of vertices. But when do I stop ? Is it simply according to a set size or perhaps my view distance??
-
If you mean assigning vertices, its up to you on how far down you want to go based on performance. Basicly pick a number of vertices, and stop subdividing when the number of vertices in a quad is lower than the number. You should make this number a parameter rather then hard coding it, so you can try several different numers when youcall the creation routine.
You see, a very larger mesh would have better formance with many quad divisions. While a smaller mesh would bennefit from a much smaller division.
-
I was thinking of using quadtrees as well. Do you generate a new quadtree every frame or do you keep updating the same quadtree?