add about page

add loading cloud station model in about page
This commit is contained in:
DefectingCat
2023-09-14 16:07:50 +08:00
parent a4f68601f6
commit 6171deaaba
4 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,23 @@
import { useLoader } from '@react-three/fiber';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader';
const CloudModel = () => {
const gltf = useLoader(
GLTFLoader,
'./models/cloud_station/modelDraco.gltf',
(loader) => {
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('./libs/draco/');
loader.setDRACOLoader(dracoLoader);
},
);
return (
<>
<primitive object={gltf.scene} />
</>
);
};
export default CloudModel;