amgl09

05-31-2009, 10:50 AM

Hi all,

I just entered openGL.

And already run into problems ;-).

For geometric calculations, I need information about triangles that are culled.

I tried program the culling myself but it somehow does not match with the culling of opengl.

See image: http://img268.imageshack.us/img268/7425/cullingproblem.jpg (this is the inner side of a head. i asked opengl to cull the front faces away)

OpenGL and my calculations are not the same. I colored the triangles according to my culling test, and basically, all triangles should be red but some are not). So I was wondering how I can debug/reproduce openGL's calculations. From the outcome, I think openGL's results are correct.

In the code, there is a

gluLookAt(x, y, z,

x + lx,y + ly,z + lz,

0.0f,1.0f,0.0f);

I then used the lx,ly, lz vector and multiplied it with the computed normal vector of my triangles (or the vertices, that i pushed into openGL during drawing).

What might be wrong?

The culling operation itself is not so hard, so I wonder what might be the error. Maybe I cannot use lx,ly,lz as a view vector?

Would be super if someone could help, it is for a freeware tool!

KR,

Ben

I just entered openGL.

And already run into problems ;-).

For geometric calculations, I need information about triangles that are culled.

I tried program the culling myself but it somehow does not match with the culling of opengl.

See image: http://img268.imageshack.us/img268/7425/cullingproblem.jpg (this is the inner side of a head. i asked opengl to cull the front faces away)

OpenGL and my calculations are not the same. I colored the triangles according to my culling test, and basically, all triangles should be red but some are not). So I was wondering how I can debug/reproduce openGL's calculations. From the outcome, I think openGL's results are correct.

In the code, there is a

gluLookAt(x, y, z,

x + lx,y + ly,z + lz,

0.0f,1.0f,0.0f);

I then used the lx,ly, lz vector and multiplied it with the computed normal vector of my triangles (or the vertices, that i pushed into openGL during drawing).

What might be wrong?

The culling operation itself is not so hard, so I wonder what might be the error. Maybe I cannot use lx,ly,lz as a view vector?

Would be super if someone could help, it is for a freeware tool!

KR,

Ben