Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Three.js-形状在反面消失_Javascript_Three.js_Webgl_Shape - Fatal编程技术网

Javascript Three.js-形状在反面消失

Javascript Three.js-形状在反面消失,javascript,three.js,webgl,shape,Javascript,Three.js,Webgl,Shape,我画了一个圆圈,如下所示: material = new THREE.MeshBasicMaterial({ color: 0x00ff00 }); arcShape = new THREE.Shape(); arcShape.absarc( 0, 0, 20, 0, -Math.PI*2, true ); geometry = arcShape.makeGeometry(); circle = new THREE.Mesh(geometry, material); scene.add(circ

我画了一个圆圈,如下所示:

material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
arcShape = new THREE.Shape();
arcShape.absarc( 0, 0, 20, 0, -Math.PI*2, true );
geometry = arcShape.makeGeometry();
circle = new THREE.Mesh(geometry, material);
scene.add(circle);
这样,它是可见的。但旋转它,它就会消失

shadow.rotation.x = Math.PI / 2;
我在其他几个帖子中看到这个问题没有得到解决。(因此,除非有人有解决办法,否则我将转而制造一个扁圆柱体。这只是一个微不足道的问题)

我已经设置了
mesh.doubleside
=true和
mesh.flipside=false
。我还尝试了切换渲染器的depthTest和材质的depthWrite属性的所有4种组合

还有什么我可以试试的吗?如果不是,我猜代码对我的一些调用顺序很敏感,在这种情况下,我已经度过了漫长的一天,所以我将坚持使用气缸

material.side = THREE.DoubleSide;