   [help] how can i build a quadtree gor my terrain
  I have a terrain and i am wonrding that how can i divide terrain into many pieces so that i can do the detection between model and terrain when model fall or jump on terrain. I have done some research about it but still don't know how to do it. Do i need to retrieve the vertex and triangle from terrain first and then divide it? if so but how to divide? I understand the theory of Quadtree but don't know how to use it to divide terrain? Can anyone help me? or provide some website with source code example.[Edited by - tomneo2004 on June 26, 2009 1:13:40 AM]
  afaik a quadtree works like this: [pseudo-code]if (Node.Objects.Count > maxObjectsCount)    SplitNodeBy4(); // creates 4 subnodes; gives all the objects to the corresponding subnode [-> check for position], so this node has no more objects, but only 4 subnodesYou have your heighmap data of the terrain somewhere. Get the height of the corresponding polygon where your character stand's on, and check if it's >= the model position. If so, a collision occured.Where exactly is your problem?   ;  It sounds like you're saying you're doing quadtrees but the problem is that your landscape at times passes through quads in the tree without a node, but you still need to check it for ground collision?Really tired but I think your solution is to loosen your quad tree to contain all items. If so just use the method of allowing an object to exist in multiple spaces.Peace, check in tomorrow when I'm fully rest   