1

I have created a transparent floor from a PlaneGeometry. But the requirement is that other objects will rise up from beneath that plane. They must not be visible until they are above the floor.

Is it possible to hide those objects despite being behind something with transparency?

Bobsworth
  • 43
  • 1
  • 4
  • See https://stackoverflow.com/questions/28869268/three-js-transparent-object-occlusion/28869802#28869802 – WestLangley Nov 23 '18 at 02:15
  • Possible duplicate of [three.js transparent object occlusion](https://stackoverflow.com/questions/28869268/three-js-transparent-object-occlusion) – Mugen87 Nov 23 '18 at 14:14

1 Answers1

1

You could use a local clipping plane, so these objects will only be visible above the plane.

See this three.js example: https://threejs.org/examples/?q=clipping#webgl_clipping

Important parts:

// plane on ground/floor level
var clippingPlane = new THREE.Plane(new THREE.Vector3(0, 1, 0), 0);

// material of objects that will rise up
var material = new THREE.MeshPhongMaterial({
    color: 0x80ee10,
    clippingPlanes: [ clippingPlane ]
    clipShadows: true
});
Brakebein
  • 2,197
  • 1
  • 16
  • 21