Skip to main content
gamedev.net
🔒 Locked

slow quadtree

Started by Neo[NB] Jun 28, 2000 at 1:14 PM 0 replies 450+ views
Original Post
Neo[NB]
Neo[NB]
Hello, I''ve implement a quadtree in my game. But the problem is, that the quadtree is slower than without one. I have a big landscape and draw only the vertices I have to draw, thats clear. So how can I optimize a quadtree? I think I found the problem: In every frame I collect from each node which have to draw the polygons and collect all vertices in one array and draw it. And the problem is, that this collection of polygons is slow, because I go through a loop to add the vertices of the node to the big array. So how can I optimize this routine? Thanks Neo www.neobrothers.de
Webmaster @www.neobrothers.de .: 3D Spiele mit Delphi programmieren :.
Claus Hansen Ries
Claus Hansen Ries
I have never used a quadtree, but never copy data were time is critical, point to them.

I would suggest,

When you walk your tree(or what you do in a quadtree) render them when you are "there", or create a linked list to nodes which has to be rendered. ( or maybe a static one )

something like:

class CRenderListNode
{
CQuadtreeNode *node;
CRenderListNode *next;
};

or

CQuadtreeNode *nodesToRender[512];


Edited by - Claus Hansen Ries on June 29, 2000 5:41:40 AM
Ries

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.