PDA

View Full Version : Quad-Tree or Oct-Tree



Colin
04-04-2012, 05:44 PM
Hello there, I can't quite get my head around how the quad-tree and/or oct-tree systems work, does anyone have some source i can study to try better understand the inner workings of these algorithms?

Any help is appreciated.

Thanks in advance.

-Colin

igmac
04-04-2012, 05:58 PM
I assume you've tried the mother of all databases, namely http://en.wikipedia.org/wiki/Octree

But if you want source code, try octree.pas from GLScene.

If you install GLScene, there is a nice Octree demo in the demos/collisions/octree folder.

Regards,

Ian.

View code: http://glscene.svn.sourceforge.net/viewvc/glscene/trunk/Source/Base/Octree.pas?view=markup

Colin
05-04-2012, 09:36 AM
Thanks i will take a look at that

Ñuño Martínez
06-04-2012, 05:26 PM
Edit: I just spotted this as well - might be the quickest way to view the source, without having to install GLScene. Website seems a bit strange, and colors a bit weird :-)
http://www.hackchina.com/en/r/21930/Octree.pas__html This is a very complex one. It think it isn't easy to figure how does an octree work from that code.

I did implement a very simple one for my 2nd PGD Entry. May be I can extract it from my engine code and show to you if you can't wait some weeks. ;)