-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComputers.jsx
45 lines (39 loc) · 1.03 KB
/
Computers.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {Suspense, useState, useEffect, } from 'react'
import {Canvas} from '@react-three/fiber';
import { OrbitControls, Preload, useGLTF } from '@react-three/drei';
import CanvasLoader from '../Loader';
import { div } from 'framer-motion/client';
const Computers = () => {
const computer = useGLTF('./desktop_pc/scene.gltf')
return (
<mesh>
<hemisphereLight intensity ={0.15}
groundColor="black"/>
<pointLight intensity={1}/>
<primitive
object={computer.scene}
/>
</mesh>
)
}
const ComputersCanvas = () => {
return (
<Canvas
frameLoop="demand"
shadows
camera={{ position: [20,3,5], fov:25 }}
gl={{ preserveDrawingBuffer:true}}
>
<Suspense fallback={<CanvasLoader/>}>
<OrbitControls
enableZoom={false}
maxPolarAngle={Math.PI /2}
minPolarAngle={Math.PI /2}
/>
<Computers/>
</Suspense>
<Preload all/>
</Canvas>
)
}
export default Computers