Hello,

Now, I'm to the point I think optimization is necessary. Right now if I create a large space (well, not so large, but big enough to get the idea) of 100x100 and render it my FPS drops to 16.


Well, currently you still drawing dinamicly, mean you add code (using loops) for draw a 100x100 grid. But when you REALLY GET in the point that you need to render big scenes with good FPS then you need to draw stuff less dinamicly like that.

Your videocard BOX package maybe advertice that your videocard can render several millions triangles per secs, maybe it is but it mean you have to feed the videocard with several millions triangles as soon as you can, but if you do a loop like

Code:
for k:=0 to 2000000 do
begin
  glbegin...
   .
   .
   .
  glend...
end;
Then the FPS will drop drastically, becouse you are involving your CPU to do a big part of the work, instead giving your GPU the most hard work.

Check others Opengl ways to render stuff, like DrawElements or Vertex Buffers, where you basically tell your videocard "here is a pointer to a block memory with the scene data, please draw 20000 triangles from that block".

Yes, the faster way to render big scenes is storing several thousands of triangles data in chunk memory and passing a pointer to opengl for that chunk and saying how much triangles it have to draw from that chunk.

The chunk data can be already pre-procesed, sorted, optimized and loaded in memory from file disk for example, so you dont have to built that dinamically every time, (here is when you need to start coding file format readers to load scenes built in a CAD program)

I'm also curious, should I be doing object culling inside my code and if so can someone point me to the "Idiots guide to object culling".
In these days where we have moderns GPU videocards, somtimes is better to draw everithing that spend some time in the CPU figuring out what is visible and what is not, remember, the videocard box advertice it can render severals millions triangles per secs, so chances are that you will spend more time doing culling in Cpu than what will take to the videocard to draw everithing, depending on how big is your scene.

For culling objects you will need:

- Usign your camera AT, Eye, and your viewport data calc the FRUSTRUM (<-google this)
you need to calc the FRUSTUM, which is a group a planes data that basically describe the cone view dimension of your current view.

- Search code/algorith in pascal for doing an AABB versus frustum test.
AABB stand for Axis aligned bounding box, which is a imaginary box in the world, if for exampel you have a 4000 triangle object, instead asking if every triangle is visible, you calc a AABB for your object (it can be pre-calculated) and just test if your AABB is visible with your current frustum, if not then dont bother rendering any of those 4000 triangle object.

Also somtimes you wil want more acuracy using a OOBB (object Oriented bounding box) instead AABB.

good luck.

tp.