INSTANCED MESHES

This commit is contained in:
2023-07-14 02:27:21 +02:00
parent a4be8e064c
commit eadae0205f
4 changed files with 220 additions and 299 deletions

View File

@@ -2,7 +2,7 @@ import * as THREE from 'three'
import { Vortex } from './Vortex.js'
class TetraScene extends THREE.Scene {
export class TetraScene extends THREE.Scene {
constructor(loadingManager, settings) {
super()
@@ -12,12 +12,15 @@ class TetraScene extends THREE.Scene {
this.vortex = new Vortex(loadingManager)
this.add(this.vortex)
this.ambientLight = new THREE.AmbientLight(0xffffff, 1)
this.ambientLight = new THREE.AmbientLight(0xffffff, .5)
this.add(this.ambientLight)
this.directionalLight = new THREE.DirectionalLight(0xffffff, 20)
this.directionalLight.position.set(5, -100, -20)
this.directionalLight = new THREE.DirectionalLight(0xffffff, 6)
this.directionalLight.position.set(5, -100, 0)
this.add(this.directionalLight)
this.directionalLight.target = new THREE.Object3D()
this.directionalLight.target.position.set(5, -50, 20)
this.add(this.directionalLight.target)
/* Sounds */
@@ -53,7 +56,4 @@ class TetraScene extends THREE.Scene {
update(delta) {
this.vortex.update(delta)
}
}
export { TetraScene }
}