HemiMG

11-03-2001, 02:34 AM

I found a tutorial on frustum culling in OpenGL and tried to implement it. One function extracts the frustum, I'll assume that one works for now(should the D value for each plane be ALOT higher than the other three? usually the other three are one or so and the last is 256 or so.)

Anyhow assuming that one works the next function tests for a cube in the frustum.

It works like so:

for(i=0li<6;i++)

{

if ((F[i][0]*x) + (F[i][1]*y) + (F[i][2]*z) + F[i][3]) > 0)

continue

//repeat that for every point in the box

return false

}

return true

(I'm sorry if that doesn't show up to well, there is no preview button)

Anyhow the problem is that no point make it through there. Am I doing something wrong? I'm tired of staring at a 3dfx logo because that function doens't let any points through! http://www.opengl.org/discussion_boards/ubb/smile.gif

Anyhow assuming that one works the next function tests for a cube in the frustum.

It works like so:

for(i=0li<6;i++)

{

if ((F[i][0]*x) + (F[i][1]*y) + (F[i][2]*z) + F[i][3]) > 0)

continue

//repeat that for every point in the box

return false

}

return true

(I'm sorry if that doesn't show up to well, there is no preview button)

Anyhow the problem is that no point make it through there. Am I doing something wrong? I'm tired of staring at a 3dfx logo because that function doens't let any points through! http://www.opengl.org/discussion_boards/ubb/smile.gif