I’m currently trying to clip only the part of 3d model that lies under the clipping plane dimensions not the whole vertical or horizontal part of the 3d model, i made a simple UI to resize the clipping planes but even if i resize the plane the whole horizontal plane is clipped instead of just the area covered by the plane
The clipping planes define a Half Space. They are only defined by a normal direction and a distance to the origin. The concept of “size” does not apply to them. They are basically “infinitely large”.
(You showed the rectangle in the screenshot. Yes, that’s that: A rectangle. This one does have a size. But this is only a visual representation for the clipping plane. It is not used for the clipping plane computations).
In order to define a “clipping shape”, you have to put multiple clipping planes into a ClippingPlaneCollection. With this, you can essentially describe a Convex Polytope.
There are two sliders (defined in the “HTML body & CSS” tab). The first slider affects the size of a square. From the corner points of this square, 4 clipping planes are created. The second slider affects the height of another clipping plane. Together, these 5 clipping planes allow you to “carve out” something cube-shaped from a tileset.
You’ll probably have to tweak and adjust that as well, for example, to create a rectangle (from width an height) and not only a square. But the example should already show the general approach of using 5 clipping planes to define the area that is supposed to be cut out here.