PDA

View Full Version : Can't Find a Good Quadtree Tutorial/Example


Nick
2005.07.17, 03:48 PM
I've been scowering the web for a while trying to figure out how to implement a quadtree into my engine for all the reasons one would wish to use a quadtree. Unfortunately all I'm finding is "each node requires four children nodes" following by a pretty diagram. I understand that each node has four children nodes but I'm having a hard time really understanding the quadtree. Is a node any single object? Do the children nodes each have four children nodes? How do you get all the squares in their diagrams of the "world"? Obviously it's a quadtree but I just don't see how the nodes relate to land. Also, partly because of these questions, I do not know how one would code such a feature. If anyone knows of any tutorials that are very in depth to the logic and possibly code samples of quadtree classes, could you please post the link?

OneSadCookie
2005.07.17, 07:45 PM
The GameDev.net tutorial is pretty good...

Nick
2005.07.18, 02:20 AM
The GameDev.net tutorial (the second one I found) is very good at explaining the logic behind the quadtree. I hope to start today and have it done later. Maybe.

For those of you in my boat, here's the link: http://www.gamedev.net/reference/articles/article1303.asp