最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Three.js - Shape disappears on flip side - Stack Overflow

programmeradmin0浏览0评论

I've made a circle as follows:

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);

Like that, it is visible. But rotate it, and it disappears.

shadow.rotation.x = Math.PI / 2;

I've seen several other posts where this problem has not been solved. (So unless someone has a solution, I'll resort to making a flat cylinder instead. It's just a niggling problem).

I've set mesh.doubleSided = true and mesh.flipSided = false. I've also tried all 4 binations of toggling the renderer's depthTest and the material's depthWrite properties.

Is there anything else I could try? If not, I'm guessing the code is sensitive to the order of some of my calls, in which case, I've had a long day so I'll stick with the cylinder!!

I've made a circle as follows:

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);

Like that, it is visible. But rotate it, and it disappears.

shadow.rotation.x = Math.PI / 2;

I've seen several other posts where this problem has not been solved. (So unless someone has a solution, I'll resort to making a flat cylinder instead. It's just a niggling problem).

I've set mesh.doubleSided = true and mesh.flipSided = false. I've also tried all 4 binations of toggling the renderer's depthTest and the material's depthWrite properties.

Is there anything else I could try? If not, I'm guessing the code is sensitive to the order of some of my calls, in which case, I've had a long day so I'll stick with the cylinder!!

Share Improve this question asked Feb 11, 2013 at 19:51 JayyJayy 14.8k27 gold badges107 silver badges167 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12
material.side = THREE.DoubleSide;
发布评论

评论列表(0)

  1. 暂无评论