Archived

This topic is now archived and is closed to further replies.

cryo75

Quadtree traversal

Recommended Posts

Hi guys I''m implementing a quadtree for a flat terrain. Currently this is the data structure:
	typedef struct tagQuadNode {
		bool		bIsNode;
		D3DXVECTOR3	vCoords[4];
		UINT		uiBranches[4];
		UINT		uiID;
		UINT		uiParentID;
	} NODE;
	NODE* pNodeList;
Would it be more efficient to change the uiBranches to pointers to child nodes/leaves structures? Secondly, I still didn''t find a way to efficiently traverse the quadtree and draw what is necessary. Anyone has ideas? Thirdly, what would be faster to render: 1. One whole vertex buffer and going through each leaf and render it individually, or 2. Go through each leaf and if it needs to be rendered, add it to temporary vertexbuffer, then render the whole vb in one go. Thanks, Ivan

Share this post


Link to post
Share on other sites