#
luxiaotao1123
2024-04-28 8877cd129a4dc36f7848101a78dbefe18263a6f8
src/pages/base.jsx
@@ -2,28 +2,42 @@
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'
import Left from './left'
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} />
                <Box position={[0, 0, 0]} />
                <Buildings />
                <TreeGroup />
                <House />
                <Warehouse />
                <OrbitControls />
                <Environment background preset="warehouse" />
                <Environment background preset="night" />
                <Help />
            </Canvas>
            <Left />
        </div>
    )
}
const Box = (props) => {
const Demo = (props) => {
    const ref = useRef()
    const [hovered, hover] = useState(false)
    const [clicked, click] = useState(false)
@@ -36,7 +50,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>
    )