# 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.

## 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;

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634059
• Total Posts
3015291
×