Currently, I have successfully created a particleCloud where the particles are positioned at each vertex of an imported object. However, my goal is to have the particles initially placed on the flat faces of the object instead of in between the vertices and to evenly distribute them on those faces.
In essence, I am aiming for my 3D object to be constructed out of particles
Here is my progress so far:
var loader = new THREE.JSONLoader();
loader.load('./resources/model.json', function (geometry, materials) {
var material = new THREE.MeshFaceMaterial(materials);
var model = new THREE.Mesh(geometry, material);
var particleCount = geometry.vertices.length,
particles = new THREE.Geometry(),
pMaterial = new THREE.PointCloudMaterial({
color: 0xFFFFFF,
size: 1
});
for (var p = 0; p < particleCount; p ++) {
particle = model.geometry.vertices[p];
particles.vertices.push(particle);
}
particleSystem = new THREE.PointCloud(particles, pMaterial);
particleSystem.position.set(0, -100, 0)
particleSystem.scale.set(100,100,100)
scene.add(particleSystem);
});
EDIT - 1
I've included an image to illustrate what I currently have and my desired outcome. I'm using the front face of a cube as an example, but my object will have more sides.