How to use Loader to Load 3D Modal in R3f React js with Threejs

Поділитися
Вставка
  • Опубліковано 21 жов 2024

КОМЕНТАРІ • 1

  • @paradise_hope
    @paradise_hope  4 місяці тому

    // src/ModelViewer.js
    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
    import { Suspense } from 'react';
    import { Html, useGLTF, useProgress } from '@react-three/drei';
    // please correct your modal path
    const Model = () => {
    const gltf = useGLTF('/hall.glb');
    return ;
    };
    const Loading = () => {
    const { progress } = useProgress();
    return Loading {progress} %;
    };
    const ModelViewer = () => {
    return (



    );
    };
    export default ModelViewer;