Three.js - Geometry on top of another

后端 未结 4 2026
耶瑟儿~
耶瑟儿~ 2020-11-29 08:01

Is it posible in Three.js to have a mesh always rendered on top of the scene, even if it\'s position is behind all objects? I\'m implementing a lasso selection with a mesh a

4条回答
  •  春和景丽
    2020-11-29 08:27

    If you want render only one mesh on front you can also manage by setting depthTest for the material of that object to false:

    var onTopMaterial = new THREE.MeshStandardMaterial({
      color: 'red',
      depthTest: false
    });
    
    mesh.material = onTopMaterial;
    

    Check a demonstation in this fiddle


    Note: Make sure you have renderer.sortObjects set to the default true value.

提交回复
热议问题