Jump to content
  • Advertisement
Sign in to follow this  

Extracting frustum planes from orthographic projection

This topic is 3478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I extract perspective-frustum planes by first extracting the corners, which are computed in this manner:
		viewFrustumCorners[0] = CVector3(-1.0f, 1.0f, 0.0f);
		viewFrustumCorners[1] = CVector3(1.0f, 1.0f, 0.0f);
		viewFrustumCorners[2] = CVector3(1.0f, -1.0f, 0.0f);
		viewFrustumCorners[3] = CVector3(-1.0f, -1.0f, 0.0f);
		viewFrustumCorners[4] = CVector3(-1.0f, 1.0f, 1.0f);
		viewFrustumCorners[5] = CVector3(1.0f, 1.0f, 1.0f);
		viewFrustumCorners[6] = CVector3(1.0f, -1.0f, 1.0f);
		viewFrustumCorners[7] = CVector3(-1.0f, -1.0f, 1.0f);

		for (int i = 0; i < 8; i++)
			viewFrustumCorners = (CVector4)viewFrustumCorners * viewProjTransformInversed;
So I start with clip-space and go back to world-space. Now I need to do the same thing but for frustum that is not perpsective, but orthographic. So I tried do it in the same way. Unfortunately I don't get proper results. Could you give me some clues on how to extract the ortho-frustum corners?

Share this post

Link to post
Share on other sites
I guess I've just found the problem. My function which calculates the inverse of a matrix returned the same matrix. It didn't compute the inverse because determinant of ortho matrix is near 0, and I have an "if" which says that in this case the computations are to be skipped, because it is not possible to compute inverse matrix from a singular input matrix. Yet ortho isn't singular (althought it's determinant is very small)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!