Local space clippingPlanes of material

Description of the problem

Feature Request:

the default clipping plane of material is in world space. this makes it not very convenient if we want the clip plane to follow the Mesh object just like a child of it.

if we treat a clip plane as a Object3D, and the material hold a reference to it. thus we can make the clip plane either in world or in local space by changing the parent of clip plane.

Three.js version
  • Dev
  • r94
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “Local space clippingPlanes of material

  1. You can clip in local space instead of world space if you transform your desired clipping plane prior to rendering.

    mesh.onBeforeRender = function() {
    
    	this.material.clippingPlanes[ 0 ].copy( clippingPlane ).applyMatrix4( this.matrixWorld );
    
    };

Comments are closed.