From 2081c72249f7e3707e1b3a2fdfba696688858d4b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 19 四月 2024 10:22:49 +0800
Subject: [PATCH] #
---
src/components/grid.jsx | 24 ++++++++++++++++++++++++
src/pages/base.jsx | 2 ++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/components/grid.jsx b/src/components/grid.jsx
new file mode 100644
index 0000000..88ed663
--- /dev/null
+++ b/src/components/grid.jsx
@@ -0,0 +1,24 @@
+import React from 'react';
+import { Grid } from '@react-three/drei';
+
+const GridModule = (gridConfig) => {
+ return (
+ <Grid
+ args={[100000, 100000, 100, 100]}
+ rotation={[0, 0, 0]}
+ position={[0, -10, 0]}
+ receiveShadow
+ cellColor="#6f6f6f"
+ cellSize={50}
+ sectionSize={100}
+ sectionThickness={1}
+ cellThickness={1}
+ sectionColor="#9d4b4b"
+ fadeDistance={10000}
+ material={<meshStandardMaterial color="#aa" />}
+ {...gridConfig}
+ ></Grid>
+ );
+};
+
+export default GridModule;
diff --git a/src/pages/base.jsx b/src/pages/base.jsx
index c36017f..61680f6 100644
--- a/src/pages/base.jsx
+++ b/src/pages/base.jsx
@@ -7,6 +7,7 @@
import Camera from '@/components/camera'
import Buildings from '@/components/buidings'
import TreeGroup from '../components/tree-group'
+import GridModule from '../components/grid'
const Base = (props) => {
return (
@@ -22,6 +23,7 @@
<Sky distance={450000} sunPosition={[0, 1, 0]} inclination={0} azimuth={0.25} />
<Buildings />
<TreeGroup />
+ <TreeGroup />
<Box position={[0, 0, 0]} />
<OrbitControls />
<Environment background preset="warehouse" />
--
Gitblit v1.9.1