#
luxiaotao1123
2024-04-19 3afd60a27d7907d558ac8c571ef9e01c2438f818
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}