gluPerspective culling planes

This is a discussion on gluPerspective culling planes within the Game Programming forums, part of the General Programming Boards category; I want to know how to determine the clipping planes for a perspective view. Say I load a bitmap. I ...

  1. #1
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926

    gluPerspective culling planes

    I want to know how to determine the clipping planes for a perspective view. Say I load a bitmap. I want to only display it where it can be viewed. Another reason is so I can define them when I draw polygons OGL doesn't have to do any calculations on them, before it realizes it doesn't have to display it.

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    theres a good article about frustum culling on flipcode ( i think its this one)

    also, i've written a cool demo which shows how to clips polygons against an arbitrary plane if your interested.

    edit: link, url, whats the difference...
    Last edited by Perspective; 07-31-2004 at 11:22 AM.

  3. #3
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    yes i am. I knew you would be the one to respond
    I am reading the article and am wondering, how do I replace this in C
    Code:
    if(m_plane[p].SideOfPlane(vCorner[i]) == BEHIND) {
    Last edited by linuxdude; 07-30-2004 at 09:03 PM.

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by linuxdude
    [...] how do I replace this in C
    well, this type of thing is well suited to OOP. If you want to use C and keep the same type of layout in the article, you could replace member functions of classes with function pointers in structs, then point the function pointers to wherever you define the functions.

    Ill have to dig out the demo, it was an assignment from last year and i dont have it hear on my laptop. ill post it up when i have a chance.

  5. #5
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    okay I can wait
    bu how would you actually get those values? Like the left clip plan, or any of them?

  6. #6
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    well, my demo is for clipping against arbitrary user defined planes. If you want to see how to extract the view frustum look at the "updateFrustum" function here
    http://nehe.gamedev.net/data/lessons....asp?lesson=44

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Solution to earlier quad-tree culling
    By VirtualAce in forum Game Programming
    Replies: 3
    Last Post: 08-10-2006, 09:04 PM
  2. Solution to culling issues?
    By VirtualAce in forum Game Programming
    Replies: 4
    Last Post: 03-14-2006, 06:59 PM
  3. Replies: 11
    Last Post: 03-25-2003, 05:13 PM
  4. 3D clipping & gluPerspective()
    By Perspective in forum Game Programming
    Replies: 8
    Last Post: 02-22-2003, 10:40 AM
  5. Please help me with interseciton of planes
    By Shadow12345 in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 11-22-2002, 03:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21