【问题标题】:how to see Custom 2D shape on both side in three.js如何在three.js中查看两侧的自定义2D形状
【发布时间】:2013-01-14 01:54:18
【问题描述】:

我是three.js和一般3d编程的新手,我用three.js绘制了一个扇区,我可以在一个方向上看到对象,但我在相反的方向上看不到它,似乎three.js examplehere 有同样的现象,我怎么能看到这两个dretions中的对象?

var squareShape = new THREE.Shape();
var arc = 1/6*Math.PI
var len = 20
squareShape.moveTo( 0,0 );
squareShape.absarc( 0, 0, 20, 4/3*Math.PI, 5/3*Math.PI, false );
squareShape.moveTo( 0, 0 );
var geometry = new THREE.ExtrudeGeometry( squareShape,  {amount:0.1} );
var mesh = THREE.SceneUtils.createMultiMaterialObject( geometry, [ new THREE.MeshLambertMaterial( { color: 0xff0000 ,opacity: 1.0} ), new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true, transparent: true ,opacity: 1.0} ) ] );
mesh.position.set( 10, 10, 10  );
mesh.rotation.set( Math.PI/2, 0, Math.PI/2 );
scene.add( mesh );

【问题讨论】:

    标签: javascript three.js custom-object


    【解决方案1】:

    在你的情况下,它会是

    new THREE.MeshLambertMaterial( { color: 0xff0000, opacity: 1.0, side: THREE.DoubleSide } )
    

    【讨论】:

      猜你喜欢
      • 2012-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-24
      • 1970-01-01
      • 1970-01-01
      • 2017-12-07
      • 2016-10-31
      相关资源
      最近更新 更多