Original Post
Ok I had this working before but disabled it to work on some other features. I have also since got a new graphics card. I dont know whats caused it but i think it maybe the new card.
the card is : http://www.gigabyte....spx?pid=3746#ov
Im setting up a clipping plane to do a water reflection map. I've looked around and i understand that this is the correct way of doing it:
When I move the camera the plane does not stay at 45 (as specified. The plane seems to get bigger as my camera's height increases. This results in a gap where the terrain meets the water.
Is it my new card? is there a solution
the card is : http://www.gigabyte....spx?pid=3746#ov
Im setting up a clipping plane to do a water reflection map. I've looked around and i understand that this is the correct way of doing it:
D3DXPlaneFromPointNormal(&plane, &D3DXVECTOR3(0,45,0),&D3DXVECTOR3(0,1,0));
D3DXMATRIXA16 matrix = currentCamera->GetViewMatrix()* matProjection ;
D3DXMatrixInverse(&matrix, NULL, &matrix); // second parameter is an out parameter for the determinant
D3DXMatrixTranspose(&matrix, &matrix);
D3DXPlaneTransform(&viewSpacePlane, &plane, &matrix);
planearray[0] = viewSpacePlane.a;
planearray[1] = viewSpacePlane.b;
planearray[2] = viewSpacePlane.c;
planearray[3] = viewSpacePlane.d;
device->SetClipPlane(0, planearray);
device->SetRenderState( D3DRS_CLIPPLANEENABLE, D3DCLIPPLANE0 );
When I move the camera the plane does not stay at 45 (as specified. The plane seems to get bigger as my camera's height increases. This results in a gap where the terrain meets the water.
Is it my new card? is there a solution