Within this code snippet, I conducted testing on the geometry
and material
variables with different return values. Interestingly, upon removing these variables, the error vanished.
var actionZ = 0;
var rotationA = 1.1;
var movementSpeed = 1;
var totalObjects = 40000;
var rotated = false;
var container = document.createElement('div');
container.className = 'home-background';
document.body.appendChild( container );
var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight,1, 2000)
camera.position.z = 2000;
var scene = new THREE.Scene();
scene.add(camera);
scene.fog = new THREE.FogExp2( 0x00b4f1, 0.0003 );
var geometry = new THREE.Geometry();
var i = 0;
for (i = 0; i < totalObjects; i ++) {
var vertex = new THREE.Vector3();
vertex.x = Math.random()*40000-20000;
vertex.y = Math.random()*7000-3500;
vertex.z = Math.random()*7000-3500;
geometry.vertices.push( vertex );
}
var material = new THREE.PointsMaterial( { size: 3, color: 0x00b4f1});
var particles = new THREE.Points( geometry, material );