protectwise / troika

A JavaScript framework for interactive 3D and 2D visualizations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clipping planes on material not working

bryaan opened this issue · comments

Is it possible to clip troika-three-text using clipping planes?
It doesn't seem to be working.

import { Text } from 'troika-three-text'

const minClippingPlane = new THREE.Plane(new THREE.Vector3(0, -1, 0), 1)
const maxClippingPlane = new THREE.Plane(new THREE.Vector3(0, -1, 0), 1)

const text = new Text()
text.text = "Hello"

text.material.clipPlanes = [minClippingPlane, maxClippingPlane]
text.material.clipIntersection = true

Clipping planes appear to work as expected for me. It's material.clippingPlanes not material.clipPlanes, and you have to set renderer.localClippingEnabled = true per the ThreeJS docs.