Trying to incorporate a system of particles, a THREE.Points element into the scene has resulted in the following error:
"THREE.Object3D.add: object not an instance of THREE.Object3D. undefined"
The code used for this is as follows:
var backCount = 1800;
var particlesG = new THREE.Geometry();
for (var p = 0; p < backCount; p++) {
var backgroundP = new THREE.Vector3();
backgroundP.x = Math.random() * 3000 - 1500;
backgroundP.y = Math.random() * 3000 - 1500;
backgroundP.z = Math.random() * 3000 - 1500;
particlesG.vertices.push(backgroundP);
}
var pMaterial = new THREE.PointsMaterial({color: 0xFFFFFF});
var particleSystemS = THREE.Points(particlesG, pMaterial);
scene.add(particleSystemS);
Any solutions or tips would be greatly appreciated.