# clipping plane equation

Hello,

I need an additional clipping plane in my 3D scene which is parralel to the x axis, parallel to the z axis and has an y coordinate of 5, and everything with an y coordinate >5 should be drawn, and everything with y<5 should be clipped.

I have no idea how to set up the clipping plane equation, I do not understand what a plane equation is at all.

Can anybody help?

Thanks
Jan

(mostly copypasted from an online tut)
>>>>>>>>>>>>>>>>
The four coefs of the plane equation :
Nx, Ny, Nz, D

Formula :
Nxx + Nyy + Nz*z + D = 0

where Nx,Ny and Nz are the 3 components of the normal to the plane. The x, y and z in the quation are the co ordinates of any point on the plane. The variable D is the distance of the plane from the origin. A point that is being tested can give three results based on where it is with respect to the plane.

1. The point is in front of the plane - In this case, the result obtained will be positive. The value obtained is the distance of the point from the plane being tested.
2. The point is behind the plane - In this case, the result will be negative. The value obtained is the distance of the point from the plane being tested.
3. The point is on the plane - The result will, quite obviously, be zero.
<<<<<<<<<<<<<<<<<<<

So, in your case, the normal to the plane is pointing downwards, and the offset D is 5.0 :

double equ[] ={ 0.0 , -1.0 , 0.0 , 5.0 };

should work but untested.

Beware, some people write the plane equation this way :
Nxx + Nyy + Nz*z = D

So you may have to negate D, ie :
double equ[] ={ 0.0 , -1.0 , 0.0 , -5.0 };

Just a guess, are trying to do your terrain reflections ?

thx

Yes I am adding terrain reflection, at the moment “only” the water… already works, looks quite good, I will post a link soon.

Jan

screenshots (although I already posted them in the other thread, but noone seems to look ):
http://de.geocities.com/westphj2003/refl.html

Jan