A plane can be defined by a normal to the plane and a point on the plane.  The x, y, z values of the normal are the a, b, c values of the plane equation with the d value equal to -dot(normal, pointOnPlane).

This can be accomplished with the following code:

// You supply these two.
Vector3f normal;
Point3f  pointOnPlane;

// The eqn of the plane.
Vector3d eqn = new Vector3d();
eqn.x = normal.x;
eqn.y = normal.y;
eqn.z = normal.z;
eqn.w = -normal.dot(new Vector3f(pointOnPlane));

Say you want to clip your model by z value (ie. you have zmin and zmax).

normal = (0, 0, 1)
point on zmax plane = (0, 0, zmax)
point on zmin plane  = (0, 0, zmin)
plane equation = (0, 0, 1, zmin + sliderValue*(zmax - zmin))

Hope this helps,
Renoir

--
Renoir Sewjee
Software Engineer
ISS International (Welkom)
Tel: +27 (0)57 912 2702
Fax: +27 (0)57 912 2652
--
  =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to