4

我正在尝试创建具有 Phong 材料特性(对光有反应)的粒子,为了实现这一点,我使用了“createMultiMaterialObject”,除了忽略粒子大小之外,这在大多数情况下都有效,出于某种原因粒子似乎是奇怪的三角形,见下文:

在此处输入图像描述

这是我正在使用的代码:

var ringGeometry = new THREE.TorusGeometry( rad, ringSize, 1, 200, Math.PI * 2);
materials = [
p2paterial = new THREE.MeshPhongMaterial({shading: THREE.SmoothShading, blending:     THREE.AdditiveBlending, transparent: true, color: ringColour, ambient: 0x000000, specular:     0xffffff, shininess: 1, vertexColors: false  } ),
pmaterial = new THREE.ParticleBasicMaterial( { size: 1, transparent: true,     vertexColors: true  } )
        ];
singleRing = new THREE.SceneUtils.createMultiMaterialObject(ringGeometry, materials);

谁能指出我如何实现最后一点的方向,使每个粒子大小为 1 - 我非常接近得到我想要的东西,我怀疑这只是我需要在某个地方调整的选项。

4

2 回答 2

0

我从来没有使用过three.js,但是我在搞乱你的小提琴,通过调整你的TorusGeometry声明中的RadialSegments的值,我得到了一些看起来更像粒子的东西......

var geometry = new THREE.TorusGeometry( 10, 10, .5, 200, Math.PI * 2);

http://jsfiddle.net/sJZeH/

于 2013-09-13T23:19:46.833 回答
0

试试这个:

var geometry = new THREE.TorusGeometry( rad, ringSize, 1, 200, Math.PI * 2);

var material = new THREE.MeshPhongMaterial({shading: THREE.SmoothShading, blending:     THREE.AdditiveBlending, transparent: true, color: ringColour, ambient: 0x000000, specular:     0xffffff, shininess: 1, vertexColors: false  } );
var mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );

var material = new THREE.ParticleBasicMaterial( { size: 1, transparent: true,     vertexColors: true  } );
var particles = new THREE.ParticleSystem( geometry, material );
scene.add( particles );
于 2013-09-09T20:19:33.613 回答