#
luxiaotao1123
2024-04-24 ef1c6cacf5aa4b2bcce35eb3b7bae2db95692edd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from "react";
import * as THREE from "three";
import TreeModel from "./tree";
 
const trees = [
    {
        position: new THREE.Vector3(1600, 0, 0),
        scale: new THREE.Vector3(0.06, 0.06, 0.06)
    },
    {
        position: new THREE.Vector3(0, 0, 1500),
        scale: new THREE.Vector3(0.1, 0.1, 0.1)
    },
    {
        position: new THREE.Vector3(100, 0, 1500),
        scale: new THREE.Vector3(0.1, 0.1, 0.1)
    },
    {
        position: new THREE.Vector3(310, 0, 1500),
        scale: new THREE.Vector3(0.13, 0.13, 0.13)
    }
];
 
function TreeGroup() {
    return (
        <group>
            {trees.map((tree, index) => (
                <TreeModel key={index} position={tree.position} scale={tree.scale} />
            ))}
        </group>
    );
}
 
export default TreeGroup;