http://rel.betterwebber.com/junk.php?id=89
'' ********************************************************
'' ** This code is best viewed in FBEDIT ( By ketilO )
''
'' Octree/Quadtree Tutorial 205
''
'' Filename:
'' Tree_tute_quad_tree_5.bas (April 5, 2k7, 11:30 AM)
''
'' Code:
'' Richard Eric M. Lope BSN RN (Relsoft)
'' Bleeding Edge Software
'' http:://rel.betterwebber.com
''
'' Description:
'' A code supplement for my octree/quadtree tutorial
'' Implements a quadtree in OpenGL
'' Node culling is done via frustum checks instead of gluUnproject
''
'' Purpose:
'' This demo shows you how to speed up your
'' scene renderer by node based clipping(even in HW accelerated GFX).
''
''
'' Notes:
''
'' This demo shows you how to use a quadtree to speed up your rendering even in OpenGL.
'' I've used a new approach in making the sources for the tutes. From now on, I'll be abusing
'' FB's OO approach to programming. This would not only make the source easier to read but also
'' minimizes some coding mistakes. I should know, I spent half an hour trying to figure out the
'' problem as to why my nodes look weird. Turned out as an ommision of the .z member of the
'' vector (operator overloading fixed it).
''
'' You should also use FBedit to compile the sources. Although this could be compiled
'' with just about any IDE, you only have to double click the .FBP file using FBedit and viola!
''
'' I used a heightmap to make the meshin this demo. If you still don't know how to make
'' meshes with heightmaps, you should check out some of nehe's tutes.
''
'' Read the code line by line because much have been changed. The orientation is right-handed
'' so the quad tree is made using the x and -z axes as bases. Y is always equal to 0 node-wise.
''
''
'' Notes on Optimization...
'' * To further optimize this render you could...
'' 1. Texture batch your meshes
'' 2. Use GPU stored redering methods such as..
'' a. Display lists
'' b. Vertex arrays or Vertex buffer objects
'' c. Reducing fillrate by drawing nearer things first
''
'' ********************************************************
Richard Eric M.Lope BSN RN
Bleeding Edge Software
http://rel.betterwebber.com
