Author Topic: Frustum Culling  (Read 4148 times)

0 Members and 1 Guest are viewing this topic.

Offline Voltage

  • Professor
  • Pentium
  • *****
  • Posts: 857
  • Karma: 53
    • View Profile
Frustum Culling
« 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.
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Frustum Culling
« Reply #1 on: June 03, 2008 »
Looking very cool, welldone dude :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Frustum Culling
« Reply #2 on: June 03, 2008 »
Indeed. Looking good! Good job!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Frustum Culling
« Reply #3 on: June 03, 2008 »
Thats looking ace, Voltage :) Trees are a good choice to test this type of function.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Frustum Culling
« Reply #4 on: June 04, 2008 »
Works fine and smootly here, welldone dude
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Frustum Culling
« Reply #5 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

what would be really cool would be to have a lib with these techniques that folks could just plug into there project.
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Frustum Culling
« Reply #6 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
Challenge Trophies Won: