three.js share a geometry for lines and particles

蹲街弑〆低调 提交于 2020-01-13 22:39:48

问题


I would like to use one geometry object for some fancy particle animation and display lines between those particles.

geometry = new THREE.Geometry();

particles = new THREE.ParticleSystem(geometry, particleMaterial);
line = new THREE.Line(geometry, lineMaterial, THREE.LinePieces);

Somehow the Line Object is not rendered in the scene, but the particles show up.

http://jsfiddle.net/Pk85y/1/


回答1:


With WebGLRenderer you can't share geometry in some specific situations. Best option is to do geometry.clone().

Here's the jsfiddle fixed: http://jsfiddle.net/Pk85y/3/



来源:https://stackoverflow.com/questions/13489228/three-js-share-a-geometry-for-lines-and-particles

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!