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';
<ObjLoader cb={(itmes)=>handleObjs(itmes)}/>
<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
Contact