Alin
Alin

Reputation: 1

Spot Light - react-three-fiber

I'm trying to understand how to use the spotLight in a 3D project and idk what im doing wrong but it's not working. The hemisphereLight, ambientLight and pointLight are working properly but spotLight even when im commenting the line nothing happens.

const Computers = ({ isMobile }) => { const computer = useGLTF("./desktop_pc/scene.gltf")

return (

  <ambientLight intensity={2.5} />
  <spotLight
    position={[-20, 50, 10]}
    angle={0.12}
    penumbra={1}
    intensity={1}
    castShadow
    shadow-mapSize={1024}
  />
  <pointLight intensity={1} />

  <primitive
    object={computer.scene}
    scale={isMobile ? 0.7 : 0.75}
    position={isMobile ? [0, -3, -2.2] : [0, -3.25, -1.5]}
    rotation={[-0.01, -0.2, -0.1]}
  />
</mesh>

) }

I tried different position / angle numbers , changing the intensity but i dont see any result

Upvotes: 0

Views: 749

Answers (1)

Atomract
Atomract

Reputation: 17

Put the spotlight where your model exists if the model is at [5,5,5] then keep the light somewhere around the same position eg [4,5,5], [5,4,5] if you keep it far the light effect dims also if you have different lights in the same scene it might be a lil bit difficult to actually see the particular light effects unless you have reflective surfaces

Upvotes: 0

Related Questions