I know of matricies in OpenGL and in my math class we just went over determinants. Are they of any importance in game programming?

Printable View

- 11-18-2004linuxdudedeterminants
I know of matricies in OpenGL and in my math class we just went over determinants. Are they of any importance in game programming?

- 11-18-2004Draco
determinants have a huge importance in game programming. Doing a vector cross product (which uses determinats) will get you the normal vector to a point/surface, etc. Just one example of this being used is most lighting algorithms. Other parts of graphics such as camera/screen orientation use them extensively as well, which is why it's programmed into OpenGL and DirectX.

- 11-18-2004Darkness
How does doing a vector cross product use determinants? Maybe there's something in the theory I've missed, but I thought a determinant is basically just a number which you must compute along the process of calculating the inverse of a matrix.

The determinant of a 3x3 matrix is calculated and returned by this function:

Quote:

inline float det3x3(float a1, float a2, float a3,

float b1, float b2, float b3,

float c1, float c2, float c3)

{

return a1*b2*c3+a2*b3*c1+a3*b1*c2-a3*b2*c1-a1*b3*c2-a2*b1*c3;

}

- 11-18-2004MrWizard
- 11-18-2004Darkness
That's cool, I guess I never really examined any formal proofs of cross product, which is why I didn't know where the determinant came into play.