#
luxiaotao1123
2024-04-19 3afd60a27d7907d558ac8c571ef9e01c2438f818
#
2个文件已修改
18 ■■■■■ 已修改文件
src/components/light.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/base.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/light.jsx
@@ -1,14 +1,20 @@
import React, { useRef } from 'react';
import { SpotLight, useDepthBuffer, useHelper } from '@react-three/drei';
import { SpotLightHelper } from 'three';
const Lights = () => {
    const spotLightRef = useRef();
    useHelper(spotLightRef, SpotLightHelper, 'teal');
    return (
        <>
            <ambientLight intensity={0.5} />
            <directionalLight color={0xffffff} intensity={3} position={[10, 10, 0]} />
            <SpotLight
                color="#fff"
                position={[3, 2000, 2]}
                ref={spotLightRef}
                color="#ffffff"
                position={[3, 700, 2]}
                castShadow
                penumbra={2}
                distance={6000}
src/pages/base.jsx
@@ -2,10 +2,10 @@
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 Buildings from '@/components/buidings'
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'