From 1a57d167f6ce92a30e88eb93cd69b9a6b6de08fa Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 22 四月 2024 16:28:09 +0800 Subject: [PATCH] # --- src/pages/base.jsx | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/pages/base.jsx b/src/pages/base.jsx index c56d04a..d98cc5f 100644 --- a/src/pages/base.jsx +++ b/src/pages/base.jsx @@ -2,20 +2,33 @@ 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 Lights from '@/components/light' -import Camera from '@/components/camera' +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> + <Canvas + shadows + gl={{ + logarithmicDepthBuffer: true, + }} + > <Lights /> - {/* <Camera /> */} + <Camera /> <Sky distance={450000} sunPosition={[0, 1, 0]} inclination={0} azimuth={0.25} /> + <Buildings /> + <TreeGroup /> + <House /> + <Warehouse /> <Box position={[0, 0, 0]} /> <OrbitControls /> - <Environment background preset="warehouse" /> + <Environment background preset="night" /> <Help /> </Canvas> </div> @@ -36,7 +49,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