Advertisement Jump to content
Sign in to follow this  

Frustrum troubles...

This topic is 4886 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

This is my actual code to compute frustum planes...but sometthing is going wrong...WHY!?!?! const float fAspectRatio = GetAspectRatio(); const iVector3 vViewDiagonal(m_fTanHalfFov, m_fTanHalfFov/fAspectRatio, 1.0F); // Near and far planes m_VSFrustumPlanes[iFRUSTUM_PLANE_NEAR] = iPlane(0, 0, 1.0F, m_fNear); m_VSFrustumPlanes[iFRUSTUM_PLANE_FAR] = iPlane(0, 0, -1.0F, m_fFar); // Left and right planes m_VSFrustumPlanes[iFRUSTUM_PLANE_RIGHT] = iPlane(1.0F, 0.0F, -vViewDiagonal.x, 0.0F); m_VSFrustumPlanes[iFRUSTUM_PLANE_LEFT] = iPlane(-1.0F, 0.0F, -vViewDiagonal.x, 0.0F); // Top and bottom planes m_VSFrustumPlanes[iFRUSTUM_PLANE_TOP] = iPlane(0.0F, -1.0F, -vViewDiagonal.y, 0.0F); m_VSFrustumPlanes[iFRUSTUM_PLANE_BOTTOM] = iPlane(0.0F, 1.0F, -vViewDiagonal.y, 0.0F); if(m_Flag&iCAMERA_NORMALIZE_PLANES) { for(DWORD i=0; i<iFRUSTUM_PLANE_COUNT; i++) m_VSFrustumPlanes.Normalize(); } // Trasform all planes in world space std::vector<iPlane>::iterator plane = m_FrustumPlanes.begin(); for(DWORD i=0; i<iFRUSTUM_PLANE_COUNT; i++, plane++) (*plane) = m_VSFrustumPlanes * m_ViewMatrix;

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!