   Octree not working properly
  I’m having problems with my octee.  I’ve built the structure and stuff but when I render it it doesn’t clip to the viewing frustum properly.  Here’s a link to a picture which shows what I’m on about.http://uk.geocities.com/oh_so_skillfull/myproblem.htmTwo segments are missing from the corners.  At the moment top & bottom clipping planes are disabled.  When enabled it’s even worse.A slight bit of movement to the left or right would bring one or both of them in to view.Here’s my clipping plane code//called when camera''s updatedVOID CBazCamera::UpdateFrustum(D3DXMATRIX t_proj, D3DXMATRIX t_view){D3DXVECTOR3 t_vec(1.0f, 1.0f, 1.0f);D3DXMATRIX t_mat = *D3DXMatrixIdentity(&t_mat);//multiply view and projection matrices together to give current//view frustumD3DXMatrixMultiply(&t_mat, &t_view, &t_proj);//left sidebc_frustum[0] = D3DXPLANE(t_mat._14 + t_mat._11, t_mat._24 + t_mat._21, t_mat._34 + t_mat._31, t_mat._44 + t_mat._41);//right sidebc_frustum[1] = D3DXPLANE(t_mat._14 - t_mat._11,t_mat._24 - t_mat._21,t_mat._34 - t_mat._31,t_mat._44 - t_mat._41);//bottombc_frustum[2] = D3DXPLANE(t_mat._14 + t_mat._12,t_mat._24 + t_mat._22,t_mat._34 + t_mat._32,t_mat._44 + t_mat._42);//topbc_frustum[3] = D3DXPLANE(t_mat._14 - t_mat._12,t_mat._24 - t_mat._22,t_mat._34 - t_mat._32,t_mat._44 - t_mat._42);//nearbc_frustum[4] = D3DXPLANE(t_mat._13, t_mat._23,t_mat._33, t_mat._43);//farbc_frustum[5] = D3DXPLANE(t_mat._14 - t_mat._13,t_mat._24 - t_mat._23,t_mat._34 - t_mat._33,t_mat._44 - t_mat._43);return;}And here’s my sphere collision code://check to see if a sphere is totally out, totally in or intersecting//the view frustumint CBazCamera::CheckSphereFrustum(D3DXVECTOR3 centre, float radious, float radious_small){float t1 = 0.0f;int i = 0;bool intersect = false;for (i = 0; i < 6; i++){if (i < 2 | i > 3){//Check with right planet1 = D3DXPlaneDotCoord(&bc_frustum, &centre);//if the dot coord is less than 0 and the absolute value of the dot//coord is > radious then the entire sphere lies outside the plane//use t1 * t1 because the radious involves using pythagorous.  Instead of//doing the final square root, square the distance from the plane.  This//is for speed.if ( t1 < 0 && (float)fabs(t1) > radious )return fc_OUTSIDE;//sphere intersects viewing frustumif ( (float)fabs(t1) < radious)return fc_INTERSECT;}}return fc_INSIDE;}I''ve tried just checking each octree segments corners and if they all lie inside then render them (i know that this would leave gaps at the edges) however, it still renders the segment even when only a tiny portion of it is on the screen.So I think that either my frustum planes are wrong or and idea I just had but haven''t checked yet is that I''m not updating my view frustum frequentley enough.Can any one confirm that my planes are correct?Thanksmattp.s. I know I''ve got another post on the go.  I thought I''d solved this probem.  Once this is fixed the other post''ll be very usefull.  Thanks to everyone who''s replied to it.  
  something is telling me you do NOT want that bitwise or in your culling code. ;  I''m not quite sure what you mean there but I did find out what the problem was.  My planes aren''t normalised.  When I normalised them it worked fine.Thanks anyway. ;  He meant the line "if (i < 2 | i > 3)", which should probably be "if (i < 2 || i > 3)". 