Skip to content

Commit

Permalink
Texture for the floor
Browse files Browse the repository at this point in the history
  • Loading branch information
JI0PATA committed Sep 26, 2023
1 parent 3858252 commit f1c91e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Ground.jsx
@@ -1,8 +1,15 @@
import * as THREE from "three";
import { useTexture } from "@react-three/drei";
import floorTexture from "./assets/floor.png";

export const Ground = () => {
const texture = useTexture(floorTexture);
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;

return (
<mesh position={[0, -5, 0]} rotation-x={-Math.PI / 2}>
<planeGeometry args={[500, 500]} />
<meshStandardMaterial color="gray" />
<meshStandardMaterial color="gray" map={texture} map-repeat={[360, 360]} />
</mesh>
);
}
Binary file added src/assets/floor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f1c91e9

Please sign in to comment.