@youyouzone/react-obj-loader
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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 License: MIT

Contact

Package Sidebar

Install

npm i @youyouzone/react-obj-loader

Weekly Downloads

0

Version

0.0.5

License

none

Unpacked Size

1.52 MB

Total Files

22

Last publish

Collaborators

  • sumnus_eric