ZhangXianQiang
2024-04-01 bd9cb65c8ee634f1f7bad5a69e891e3a4f46b768
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import * as THREE from 'three';
 
export default class Test {
    constructor(experience) {
        this.experience = experience;
        this.scene = this.experience.scene;
 
        this.setGeometry();
        this.setMaterial();
        this.setMesh();
    }
    setGeometry() {
        this.geometry = new THREE.BoxGeometry(2,2,2);
    }
    setMaterial() {
        this.geometryMaterial = new THREE.MeshStandardMaterial({
            color: '#db929d'
        });
    }
    setMesh() {
        this.geometrytMesh = new THREE.Mesh(this.geometry, this.geometryMaterial);
        this.scene.add(this.geometrytMesh);
    }
}