【问题标题】:Is it possible to hide parts of an aframe entity?是否可以隐藏框架实体的一部分?
【发布时间】:2018-08-11 04:20:22
【问题描述】:

是否有相当于 CSS 的溢出:隐藏在框架中的东西?例如,我可以将一个整体限制在一个边界内,并让所有大于盒子几何形状的东西都隐藏/不可见吗?

【问题讨论】:

    标签: three.js aframe


    【解决方案1】:

    有剪裁平面:https://threejs.org/examples/webgl_clipping.html

    https://github.com/mrdoob/three.js/blob/master/examples/webgl_clipping.html

    // ***** Clipping planes: *****
                    var localPlane = new THREE.Plane( new THREE.Vector3( 0, - 1, 0 ), 0.8 );
                    var globalPlane = new THREE.Plane( new THREE.Vector3( - 1, 0, 0 ), 0.1 );
                    // Geometry
                    var material = new THREE.MeshPhongMaterial( {
                            color: 0x80ee10,
                            shininess: 100,
                            side: THREE.DoubleSide,
                            // ***** Clipping setup (material): *****
                            clippingPlanes: [ localPlane ],
                            clipShadows: true
                        } );
                    var geometry = new THREE.TorusKnotBufferGeometry( 0.4, 0.08, 95, 20 );
                    object = new THREE.Mesh( geometry, material );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-05
      • 1970-01-01
      • 1970-01-01
      • 2013-08-20
      • 2014-02-10
      • 1970-01-01
      • 2018-07-16
      • 1970-01-01
      相关资源
      最近更新 更多