Jump to content
  • Advertisement
Sign in to follow this  


This topic is 2097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've understood quadtrees but I have problems with understanding octrees.


quad-trees have a parent node which has 4 children and each child has another 4 children and it keeps on going (we keep on subdividing) until we've reached a certain number of triangles. .


like this

struct qtreeNode 


    qtreeNode* child[4];



qtreeNode* parentNode;



but what are octrees? I've read on wiki and it says that it's each internal node has 8 children but honestly I don't understand it (figures are confusing me).

Edited by newtechnology

Share this post

Link to post
Share on other sites

Quadtrees are a 2D subdivision, octrees are 3D or "2 quadtrees on top of each other".

In quadtrees the division is only in 2 axis (x,y). So the z-position of an object doesn't matter.

In octrees the third axis is also used for subdivision, so the z-position is evaluated, if an object is in the upper or lower quadtree of an octree.

Share this post

Link to post
Share on other sites

In 2D you draw a North-South line and an East-West line, thus dividing the plane in 4 regions:

 * North + East

 * North + West

 * South + East

 * South + West


In 3D, you "draw" a horizontal floor, a North-South wall and an East-West wall, thus dividing the space in 8 regions:

 * Up + North + East

 * Up + North + West

 * Up + South + East

 * Up + South + West

 * Down + North + East

 * Down + North + West

 * Down + South + East

 * Down + South + West


Does that clear things up?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!