So I Have some old particle code that i am using they work fine enough as I’ve used them before but in my recent project i can’t seem for the life of me to be able to position them can someone point me in the right direction of how to position them properly i'm guessing they are behind the camera?
CodePen: https://codepen.io/uiunicorn/pen/xxrpYPP
Code:
var geometryParticle = new THREE.BufferGeometry();
var vertices = [];
var textureLoader = new THREE.TextureLoader();
var sprite1 = textureLoader.load("particl.png");
partcount = 250;
for (var i = 0; i < partcount; i++) {
var x = Math.random() * 500 - 250;
var y = Math.random() * 500 - 250;
var z = Math.random() * 500 - 250;
vertices.push(x, y, z);
}
geometryParticle.setAttribute("position", new THREE.Float32BufferAttribute(vertices, 3));
parameters = [
[[0.8, 0, 0.5], sprite1, 5],
[[0.8, 0, 0.5], sprite1, 2],
[[0.8, 0, 0.5], sprite1, 4],
[[0.8, 0, 0.5], sprite1, 2],
[[0.8, 0, 0.5], sprite1, 3],
];
for (var i = 0; i < parameters.length; i++) {
var color = parameters[i][0];
var sprite = parameters[i][1];
var size = parameters[i][2];
materials[i] = new THREE.PointsMaterial({ size: size, map: sprite, blending: THREE.AdditiveBlending, depthTest: false, transparent: true });
materials[i].color.setHSL(color[0], color[1], color[2]);
var particles = new THREE.Points(geometryParticle, materials[i]);
particles.rotation.x = Math.random() * 6;
particles.rotation.y = Math.random() * 6;
particles.rotation.z = Math.random() * 6;
particles.position.z = Math.random() * 6;
scene.add(particles);
}
var params = {
texture: true,
};
Best i've done so far as you can see the particles are way to close to the camera and most of them aren't showing in the scene
thanks in advance!