@youyouzone/react-obj-loader
v0.0.5
Published
<p align="center"> <img src="./screenshot/profile.gif" alt=''> </p>
Downloads
2
Maintainers
Readme
React-Obj-Loader
React component for loading 3D objs by drag-and-drop files based on loaders in Threejs.
Support: glTF/obj/stl
Installation
npm install @youyouzone/react-obj-loader
Usage
import ObjLoader from '@youyouzone/react-obj-loader';
// use as an area
<ObjLoader cb={(itmes)=>handleObjs(itmes)}/>
// uas as a container
<ObjLoader cb={(itmes)=>handleObjs(itmes)}>
<canvas/>
</ObjLoader>
Then Drop the folder which contains objs files on ObjLoader.
Props:
- cb?: (items: Object3D[]) => any - custom callback which accept threejs Object3D array.
- className?: string - custom class name.
- normalized?: boolean - resize obj to unit size or not.
License
This project is licensed under