background switcher

This commit is contained in:
2023-07-08 17:33:04 +02:00
parent f0f3b2aca5
commit 9877f21818
4 changed files with 53 additions and 4 deletions

View File

@@ -15,12 +15,14 @@ class Vortex extends THREE.Group {
super()
const commonCylinderGeometry = new THREE.CylinderGeometry(35, 35, 500, 12, 1, true)
this.background = "Plasma"
this.darkCylinder = new THREE.Mesh(
commonCylinderGeometry,
new THREE.MeshLambertMaterial({
side: THREE.BackSide,
map: new THREE.TextureLoader(loadingManager).load("images/plasma.jpg", (texture) => {
map: new THREE.TextureLoader(loadingManager).load("./images/plasma.jpg", (texture) => {
texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(1, 1)
@@ -36,7 +38,7 @@ class Vortex extends THREE.Group {
commonCylinderGeometry,
new THREE.MeshBasicMaterial({
side: THREE.BackSide,
map: new THREE.TextureLoader(loadingManager).load("images/plasma2.jpg", (texture) => {
map: new THREE.TextureLoader(loadingManager).load("./images/plasma2.jpg", (texture) => {
texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(2, 1)