From 73e5e4f17c23a7f4832ea2bb36e1bd3799ab9ad9 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 26 四月 2024 14:28:03 +0800
Subject: [PATCH] #
---
src/pages/base.jsx | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/src/pages/base.jsx b/src/pages/base.jsx
index 59a35bc..ce6ec8c 100644
--- a/src/pages/base.jsx
+++ b/src/pages/base.jsx
@@ -2,19 +2,32 @@
import { Canvas, useFrame } from '@react-three/fiber'
import { OrbitControls } from '@react-three/drei'
import { Environment, Sky } from '@react-three/drei'
-import Help from '@/components/help'
+import Help from '../components/help'
+import Lights from '../components/light'
+import Camera from '../components/camera'
+import Buildings from '../components/buidings'
+import TreeGroup from '../components/tree-group'
+import House from '../components/house'
+import Warehouse from '../core/warehouse'
const Base = (props) => {
return (
<div style={{ height: '100%', width: '100%' }}>
- <Canvas>
- <ambientLight intensity={Math.PI / 2} />
- <spotLight position={[10, 10, 10]} angle={0.15} penumbra={1} decay={0} intensity={Math.PI} />
- <pointLight position={[-10, -10, -10]} decay={0} intensity={Math.PI} />
- <Box position={[0, 0, 0]} />
- <OrbitControls />
+ <Canvas
+ shadows
+ gl={{
+ logarithmicDepthBuffer: true,
+ }}
+ >
+ <Lights />
+ <Camera />
<Sky distance={450000} sunPosition={[0, 1, 0]} inclination={0} azimuth={0.25} />
- <Environment background preset="warehouse" />
+ <Buildings />
+ <TreeGroup />
+ <House />
+ <Warehouse />
+ <OrbitControls />
+ <Environment background preset="night" />
<Help />
</Canvas>
</div>
@@ -22,7 +35,7 @@
)
}
-const Box = (props) => {
+const Demo = (props) => {
const ref = useRef()
const [hovered, hover] = useState(false)
const [clicked, click] = useState(false)
@@ -35,7 +48,7 @@
onClick={(event) => click(!clicked)}
onPointerOver={(event) => (event.stopPropagation(), hover(true))}
onPointerOut={(event) => hover(false)}>
- <boxGeometry args={[1, 1, 1]} />
+ <boxGeometry args={[10, 10, 10]} />
<meshStandardMaterial color={hovered ? 'hotpink' : 'orange'} />
</mesh>
)
--
Gitblit v1.9.1