Dark Bit Factory & Gravity

PROGRAMMING => Freebasic => Topic started by: Voltage on June 03, 2008

Title: Frustum Culling
Post by: Voltage on June 03, 2008
Some code that:

1) Rotates the camera
2) Extracts the view frustum planes from OpenGL
3) Loops through all objects (30 000)
4) Compares the objects bounding sphere to the frustum
5) Draws if possibly inside the view

The OpenGL window setup code is by rbraz (what a guy), thank you.

The frustum clipping is all explained http://www.crownandcutlass.com/features/technicaldetails/frustum.html.

The next steps on my list are:
1) Delta timing
2) FPS counter
3) Quadtree
4) Skydome

My goal for this engine is to be able to walk around a large world, with terrain with many objects.
Title: Re: Frustum Culling
Post by: Clyde on June 03, 2008
Looking very cool, welldone dude :)
Title: Re: Frustum Culling
Post by: benny! on June 03, 2008
Indeed. Looking good! Good job!
Title: Re: Frustum Culling
Post by: Shockwave on June 03, 2008
Thats looking ace, Voltage :) Trees are a good choice to test this type of function.
Title: Re: Frustum Culling
Post by: Rbz on June 04, 2008
Works fine and smootly here, welldone dude
Title: Re: Frustum Culling
Post by: ninogenio on June 04, 2008
very cool work voltage!

jim showed me how to do something like this before although i think we might have done it slightly diffrently http://dbfinteractive.com/index.php?PHPSESSID=17e57cb43b381ce0609ce8db11881ba0&topic=1690.0 (http://dbfinteractive.com/index.php?PHPSESSID=17e57cb43b381ce0609ce8db11881ba0&topic=1690.0)

what would be really cool would be to have a lib with these techniques that folks could just plug into there project.
Title: Re: Frustum Culling
Post by: Jim on June 04, 2008
Did I?  Crikey, you're right!
The article Voltage linked to is much clearer, but it wastes a bit of effort in the sums.  Get it working first though :)

Jim