【问题标题】:Drawing edges of a mesh in Three.js在 Three.js 中绘制网格的边缘
【发布时间】:2016-07-28 03:02:18
【问题描述】:

有没有像 Stroke 这样的东西来绘制网格的边缘?

我想让我的对象看起来像这样:

【问题讨论】:

    标签: three.js mesh


    【解决方案1】:

    编辑:此答案已过时,已更新。


    如果您只想渲染网格的边缘,可以使用EdgesGeometry

    var geometry = new THREE.EdgesGeometry( mesh.geometry );
    
    var material = new THREE.LineBasicMaterial( { color: 0xffffff } );
    
    var wireframe = new THREE.LineSegments( geometry, material );
    
    scene.add( wireframe );
    

    您也可以使用THREE.WireframeGeometry

    有关如何渲染边和面的示例,请参阅this stackoverflow answer

    three.js r.94

    【讨论】:

    • 谢谢,但是可以同时渲染边缘和面吗?
    猜你喜欢
    • 2020-06-20
    • 1970-01-01
    • 2016-02-16
    • 2020-12-16
    • 2017-06-02
    • 2021-05-28
    • 2021-06-03
    • 2014-06-02
    • 1970-01-01
    相关资源
    最近更新 更多