sphere() { const geometry = new THREE.SphereGeometry(); const material = new THREE.MeshBasicMaterial({ color: Math.random() * 0xffffff }); return new THREE.Mesh(geometry, material); }
make(type) { if(type === 'plane') { return (width, height, widthSegments = 1, heightSegments = 1) => { this.geo = new THREE.PlaneGeometry(width, height, widthSegments, heightSegments); }; } if(type === 'sphere') { return (radius, widthSegments = 32, heightSegments = 32) => { this.geo = new THREE.SphereGeometry(radius, widthSegments, heightSegments); }; } }