PlaneHelper has a different clipping location then object in the scene

I have a plane helper that was initially put on x = 50. At first, the clipping is exactly at 50 but after moving the planehelper (by using drag controls with a Line3 so that each plane helper is moved on its path) the clipping plane is no longer the same as the helper plane location.

The further I move the plane the longer the tail is (as seen in the image). The clipping effect is at the level of the tail end rather than the helper plane. Of course, I am updating the constant of the Math Plane according to the position of the helper plane while dragging.
tail

Maybe you are not updating Plane.constant correctly. Have you tried to transform the plane via Plane.translate()?

var constant = helpersArray[index].position.x;
this.clipPlanes[index].constant = constant;

Is that the correct way ?

I’ll also try using the translate.

Unfortunately not. I suggest you study the Hessian normal form in order to understand the sign of Plane.constant. I recommend to work with Plane.translate() instead:

Is it possible to explain to me why it works in this example ?

				for ( var j = 0; j < clipPlanes.length; j ++ ) {

					clipPlanes[ j ].constant = value;

				}

Of course you can set the constant value directly. But if you don’t understand what the sign means, it’s all guess work. Studying the Hessian normal form should answer your question.

1 Like

I still do not get what I did wrong. I am setting the constant value exactly as the mentioned example

for ( var j = 0; j < clipPlanes.length; j ++ ) {
		clipPlanes[ j ].constant = value;
}

The only difference is, instead of getting the value from the dat gui slider, I am getting the value from the dragged position of the PlaneHelper.

The object is getting clipped, but the clipping is occurring at the level of the “tail” of the helper plane rather than at the plane itself.

tail - Copy