Sign in to follow this  
yuppies

Extracting the Near Clipping Plane?

Recommended Posts

yuppies    116
whats the right way of extracting the new clipping plane in DX? some tutorials extract the near plane like this //near frustum[ 4 ].A = comboMatrix.M13; frustum[ 4 ].B = comboMatrix.M23; frustum[ 4 ].C = comboMatrix.M33; frustum[ 4 ].D = comboMatrix.M43; and other tutorials extract the near plane like this frustum[ 4 ].A = comboMatrix.M14 + comboMatrix.M13; frustum[ 4 ].B = comboMatrix.M24 + comboMatrix.M23; frustum[ 4 ].C = comboMatrix.M34 + comboMatrix.M33; frustum[ 4 ].D = comboMatrix.M44 + comboMatrix.M43; whats the right one?

Share this post


Link to post
Share on other sites
ms291052    223
My code works with the former, however, I believe that typically 14, 24, 34, and 44 are zero. I may be wrong, but my code uses the former.

Share this post


Link to post
Share on other sites
kandemor    122
If you are working with DirectX you can use the first way, because in DirectX the box in clipping space ( only for the z component ) starts at 0 and ends at w.

If you want to use OpenGL you must use the second way.


You can find more information in:

http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf
http://crownandcutlass.sourceforge.net/frustum.html

Bye!

VinCenT.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this