import React, { Suspense, useEffect, useState } from ‘react’;
import { Canvas } from ‘@react-three/fiber’;
import { OrbitControls, Preload, useGLTF } from ‘@react-three/drei’;
import CanvasLoader from ‘…/Loader’;
//import { HemisphereLight, PointLight } from ‘three’;
const Computers = () => {
const computer = useGLTF(“./desktop_pc/scene.gltf”)
return (
<spotLight
position={[-20, 50, 10]}
angle={0.12}
penumbra={1}
intensity={1}
castShadow
shadow-mapSize = {1024} />
<primitive
object={computer.scene}
scale={0.75}
position={[0, -3.25, -1.5]}
rotation={[-0.01, -0.2, -0.1]} />
);
};
const ComputerCanvas = () => {
return (
<Canvas allback={}
frameloop=‘demand’
shadows
camera={{ position: [20, 3, 5], fov: 25 }}
gl={{ preserveDrawingBuffer: true }}>
<Suspense fallback={} >
<OrbitControls
enableZoom={false}
maxPolarAngle={Math.PI / 2}
minPolarAngle={Math.PI / 2}
/>
<Preload all />
</Canvas>
);
};
export default ComputerCanvas
I am trying to use hemisphereLight and pointLight in this particular example. But It is not working. I couldn’t see any light in my model. When I took a pull from the github repo, it is working perfectly. Please let me know if you find any error, because i am tired of trying every possible way i saw on internet