starboarder2001
07-31-2003, 02:36 AM
This isn't really the right forum...but I didn't know were else to post it. I am using opengl for this though :P .
my first question:
Ok I decided to give it a try. I have a terrain map 128by128. I divided it down until there are 256 polygons in each node. I got a average of 20-50fps increase so i know it is doing its job. Right now I am using a linked list to hold the nodes. Is what I wanted to know is..What is the best way to store the nodes...have a linked list or a array? it seems to work fine but I just wondered what the "correct" or the most popular way was?
my second question:
I have never used linked lists before so i just wanted to make shure i have a ok understanding of what they are...and how to use them. :blush:
//example -I know that this wouldnt run i am not going to allocate memory...i am to lasy to do it for the example so just ignore that :)
struct LIST{
int data;
LIST *list;
};
int num = NULL;
void SetList(LIST *list){ //create a list of 10 and set data to num
num++;
list->data = num;
if(num < 10){
SetList(list);
}
}
my third question:
I dont know if it is a bug or what but when i divide it until each node has 64 polygons it probably takes about 10 seconds to build the tree. If I devide it down to 256 it works fine it only takes a few seconds. I know it will be hard to answere becuase you cant see my code...but i just wondered if it is normal to take that long to build the tree of that size?
my first question:
Ok I decided to give it a try. I have a terrain map 128by128. I divided it down until there are 256 polygons in each node. I got a average of 20-50fps increase so i know it is doing its job. Right now I am using a linked list to hold the nodes. Is what I wanted to know is..What is the best way to store the nodes...have a linked list or a array? it seems to work fine but I just wondered what the "correct" or the most popular way was?
my second question:
I have never used linked lists before so i just wanted to make shure i have a ok understanding of what they are...and how to use them. :blush:
//example -I know that this wouldnt run i am not going to allocate memory...i am to lasy to do it for the example so just ignore that :)
struct LIST{
int data;
LIST *list;
};
int num = NULL;
void SetList(LIST *list){ //create a list of 10 and set data to num
num++;
list->data = num;
if(num < 10){
SetList(list);
}
}
my third question:
I dont know if it is a bug or what but when i divide it until each node has 64 polygons it probably takes about 10 seconds to build the tree. If I devide it down to 256 it works fine it only takes a few seconds. I know it will be hard to answere becuase you cant see my code...but i just wondered if it is normal to take that long to build the tree of that size?