ZhangXianQiang
2024-03-29 fd9a2a05829f84dd3925da8fabec901498ebb9e0
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);
    }
}