adrianhajdin / project_3D_developer_portfolio

The most impressive websites in the world use 3D graphics and animations to bring their content to life. Learn how to build your own ThreeJS 3D Developer Portfolio today!
https://jsmastery.pro
5.71k stars 1.26k forks source link

can not render the computer element #146

Closed walid885 closed 2 months ago

walid885 commented 2 months ago

here is the computer.jsx file `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";

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 ={}> <OrbitControls enableZoom ={false} maxPolarAngle={Math.PI /2} minPolarAngle={Math.PI /2}

/>

</canvas>

) } export default Computers`

the server is running, but here are the issues here image

and I can't figure out what is the issue

walid885 commented 2 months ago

Isssue solved , and I think I made a typo somewhere , refering to the file given in this repo, it works fine.