projet-nuitinfo-2024/front/src/components/3d/Floor.tsx

18 lines
No EOL
506 B
TypeScript

import { Group } from 'three'
import * as THREE from 'three'
export default function Floor() {
const floor = new Group()
const floorGeometry = new THREE.PlaneGeometry(100, 100, 100, 100)
const floorMaterial = new THREE.MeshStandardMaterial({ color: 0x00ff00, side: THREE.DoubleSide })
const floorMesh = new THREE.Mesh(floorGeometry, floorMaterial)
floorMesh.rotation.x = -Math.PI / 2
floorMesh.position.y = -2
floor.add(floorMesh)
return <primitive object={floor} />
}