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
6.15k stars 1.38k forks source link

Cant load the 3D Computer #138

Open DonJuan2968 opened 8 months ago

DonJuan2968 commented 8 months ago

I did everything in the yt vid and im not getting the 3D model in my browser here is the code for Computers.jsx `import { 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 (

) }

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} />

  <Preload all />
</Canvas>

) }

export default ComputersCanvas; and the Hero code import { motion } from 'framer-motion'; import { styles } from '../styles'; import { ComputersCanvas } from './canvas';

const Hero = () => { return (

Hallo, Ik ben Justin

Ik ben een gepassioneerde Software
Development
Student

) }

export default Hero // lijn kleur aanpassen naar violet-gradient`

the error codes in the console hemisphereLight incorrect cassing use pascal for react i also have this for pointLight

akibiaons commented 8 months ago

Does everything else load but the 3D model?? Also what kind of errors are you getting in Chrome Dev tools?

Abhijeetkadtan commented 6 months ago

Does everything else load but the 3D model?? Also what kind of errors are you getting in Chrome Dev tools?

Error: Objects are not valid as a React child (found: object with keys {isObject3D, uuid, name, type, parent, children, up, position, rotation, quaternion, scale, matrix, matrixWorld, matrixAutoUpdate, matrixWorldAutoUpdate, matrixWorldNeedsUpdate, layers, visible, castShadow, receiveShadow, frustumCulled, renderOrder, animations, userData, isGroup}). If you meant to render a collection of children, use an array instead.