【问题标题】:Three.js - Issues with shapes and inside holesThree.js - 形状和内孔的问题
【发布时间】:2012-08-08 08:08:48
【问题描述】:

我有一个问题,我怎样才能获得一种像圆环但平方的“开环”? 我尝试用一​​个形状加上一个路径作为一个洞:

var arcShape = new THREE.Shape();   
arcShape.moveTo( 40, 0 );   
arcShape.arc( 0, 0, 40, 0, 2*Math.PI, false );  

var holePath = new THREE.Path();
holePath.moveTo( 30,0 )
holePath.arc( 0, 0, 30, 0, 2*Math.PI, true );

直到现在,制作一个网格:

new THREE.Mesh( arcShape.extrude({ amount: 5, bevelEnabled: false }), MATERIAL );

它有效,但如何制作中间环?我的意思是:

 var arcShape = new THREE.Shape();  
 arcShape.moveTo( 40, 0 );  
 arcShape.arc( 0, 0, 40, 0, Math.PI, false );   

 var holePath = new THREE.Path();
 holePath.moveTo( 30,0 );
 holePath.arc( 0, 0, 30, 0, Math.PI, true );

它可以工作,但它仍然是终端部分之间的一个微妙的面孔……有没有办法让它完全打开?

【问题讨论】:

    标签: javascript three.js


    【解决方案1】:

    与其从第一方开始,不如尝试更改 Torus 几何构造函数中的参数:

    // Torus geometry parameters:
    //     radius of entire torus,
    //     diameter of tube (should be less than total radius), 
    //     segments around radius, 
    //     segments around torus ("sides")
    var torusGeom = new THREE.TorusGeometry( 25, 10, 4, 4 );
    

    【讨论】:

      猜你喜欢
      • 2012-10-08
      • 2017-02-22
      • 2020-06-28
      • 2013-04-13
      • 2020-02-21
      • 2012-03-17
      • 2016-03-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多