   Is Vector in FOV
  Hello,I would like to know how i can know if a VECTOR3 is in the camera FOV in DirectX8.I been searching in google about it but no reult :(Thanks alot.   
Results 1 - 10 of about 73,500 for point in frustum.Moving this thread to Math and Physics, since it's more of a general maths question than DX related.   ;  Actually moving the thread this time, honest...   ;  i understood how to get the 6 needed planes, but i cant get how i can check if the Vector is in the FOV :SCan someone pls help me in this ?Thanks very much :D   ;Quote:Original post by yoni1993i understood how to get the 6 needed planes, but i cant get how i can check if the Vector is in the FOV :SYou just need to check if the vector is on the correct side of each frustum plane. For each of the 6 planes, you take the dot product of the plane and the point. If the dot product is positive, it's on the correct side of that plane. If you're using the D3DXPLANE class, there's the D3DXPlaneDot function which will do that for you.If the point is on the correct side of all 6 planes, it's in the frustum.   ;  I start to understand it, thanks you.Just one more thing, you told me to get the dot of a plane and check if the point if in the right side of the plane, how do i do that check ?Thanks alot   ;Quote:Original post by yoni1993Just one more thing, you told me to get the dot of a plane and check if the point if in the right side of the plane, how do i do that check ?If the dot product returns a positive value, then the point is on the front side of the plane. If you're using D3DXPLANE, then you can use the D3DXPlaneDot function for this, if not, then the dot product is the dot product of the plane normal and your vector, plus "d".   ;  Thank you very much for your support Evil Steeve :)I got this:D3DXPLANE dxPlanes[6];for (int i = 0; i < 6; i++)pDevice->GetClipPlane(i, dxPlanes);ret = D3DXPlaneDotCoord(dxPlanes, &CoordToCheck);while CoordToCheck is the point i want to check if its in the FOV.The problem is D3DXPlaneDot take a VECTOR4 and my coords is a VECTOR3.I tested  D3DXPlaneDotCoord and D3DXPlaneDotNormal, both returning me 0.0000 no matter when (while i see the dot and while not).Thanks very much for any firther help :);  GetClipPlane() is only used for user defined clip planes, not for the frustum planes, so unless you're setting your own user defined clip planes that match the frustum, this won't give you the results you expect. You'll have to extract the frustum planes from the view/projection matrix. This Link looks promising (See the BuildViewFrustum() function).And yes, sorry - I meant D3DXPlaneDotCoord not D3DXPlaneDot.   ;D3DXPLANE dxPlanes[6];D3DXMATRIX viewProjection = View * Proj;// Left planedxPlanes[0].a = viewProjection._14 + viewProjection._11;dxPlanes[0].b = viewProjection._24 + viewProjection._21;dxPlanes[0].c = viewProjection._34 + viewProjection._31;dxPlanes[0].d = viewProjection._44 + viewProjection._41;// Right planedxPlanes[1].a = viewProjection._14 - viewProjection._11;  dxPlanes[1].b = viewProjection._24 - viewProjection._21;dxPlanes[1].c = viewProjection._34 - viewProjection._31;dxPlanes[1].d = viewProjection._44 - viewProjection._41;// Top planedxPlanes[2].a = viewProjection._14 - viewProjection._12;  dxPlanes[2].b = viewProjection._24 - viewProjection._22;dxPlanes[2].c = viewProjection._34 - viewProjection._32;dxPlanes[2].d = viewProjection._44 - viewProjection._42;// Botto_ planedxPlanes[3].a = viewProjection._14 + viewProjection._12;  dxPlanes[3].b = viewProjection._24 + viewProjection._22;dxPlanes[3].c = viewProjection._34 + viewProjection._32;dxPlanes[3].d = viewProjection._44 + viewProjection._42;// Near planedxPlanes[4].a = viewProjection._13;  dxPlanes[4].b = viewProjection._23;dxPlanes[4].c = viewProjection._33;dxPlanes[4].d = viewProjection._43;// Far planedxPlanes[5].a = viewProjection._14 - viewProjection._13;  dxPlanes[5].b = viewProjection._24 - viewProjection._23;dxPlanes[5].c = viewProjection._34 - viewProjection._33;dxPlanes[5].d = viewProjection._44 - viewProjection._43;// Normalize planesfor ( int i = 0; i < 6; i++ )D3DXPlaneNormalize(&dxPlanes, &dxPlanes);ret = D3DXPlaneDotCoord(dxPlanes, &PointToCheck);Its worked, it gave me a number, but it was also negative when i coudnt see the dot.Between i coudl see the player where the return number was between 0 to 2218. the 2218 get grow if i move backward, so then i can see the player between 0 to 3000~4000. more backward, more its grow.But im not sure its will be like that for any resolution !Any workaround for this ?Than you very very much Steeve :)I got so far atleast with your help :)DotCoord() = D3DXPlaneDotCoordDotCoord()= 0    |  PointToCheck||    |DotCoord() GREATER 0  Camera   DotCoord() LESS THAN 0    |    |    ||DotCoord()= 0  Hope this design can help.Evile Steeve, Since you moderator, enter in "Edit post" of this post, then you will see this diagram with the spaces, the forum render it witout the spaces i dont know why.[Edited by - yoni1993 on May 7, 2009 11:41:06 AM]