If now made a terrain-implementation that satifies me, so I've decided to move on a little ;) It's now time for me to make some water, but already at this early state I've run into problems.
What I want is to clip everything beneath y = 0.0f, so I've defined my plane using simple DirectX measures (I'm to lazy to do the plane-math myself ;)
D3DXPLANE ClippingPlane;
D3DXVECTOR3 Point(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 Normal(0.0f, 1.0f, 0.0f);
D3DXPlaneFromPointNormal(&ClippingPlane, &Point, &Normal);
Now, this seems to be fine, if you ask me. So, to get to the point, when I apply this to the screen like this:
Engine.DX.D3DDevice->SetClipPlane(0, ClippingPlane);
Engine.DX.D3DDevice->SetRenderState(D3DRS_CLIPPLANEENABLE, D3DCLIPPLANE0);
Engine.DX.D3DDevice->SetRenderState(D3DRS_CLIPPING, TRUE);
... it seems to be clipping in eye space (half of the screen simply gets clipped). I've tried putting the Point-coordinates into View-, WorldView-, World-, Projection-, WorldViewProjection, ViewProjection - and so on -space, but without any luck (or I should say so -- if anyone knows which one of these I should use please inform me ;)
My vertices are processed in a vertex-shader multiplying position with WorldViewProjection, and as the user-defined clipping happens after the vertex shader, I guessed that it had to be in this space, but now I'm completely lost.
What am I doing wrong? :)
Thanks in advance
Nizro