https://github.com/enjikaka/obj-viewer
A Three.js based Web Component for displaying OBJ files along with MTL files on the modern web.
https://github.com/enjikaka/obj-viewer
three-js web-components
Last synced: 9 months ago
JSON representation
A Three.js based Web Component for displaying OBJ files along with MTL files on the modern web.
- Host: GitHub
- URL: https://github.com/enjikaka/obj-viewer
- Owner: enjikaka
- Archived: true
- Created: 2019-02-22T19:23:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-23T18:35:34.000Z (over 7 years ago)
- Last Synced: 2025-01-17T06:46:33.609Z (over 1 year ago)
- Topics: three-js, web-components
- Language: JavaScript
- Homepage: https://enjikaka.github.io/obj-viewer/
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ``
A Three.js based Web Component for displaying OBJ files along with MTL files on the modern web.
Note: Uses ResizeObserver. Polyfill it on your end.
## API
### Inputs
| Attribute | Description |
| --- | --- |
| `obj-source` | A path to your OBJ file. Local path or URL. |
| `mtl-source` | A path to your MTL file. Local path or URL. |
| `display-grid` | Wether or not to draw the grid. Boolean. |
## Usage
Install obj-viewer via npm and import it in your webpack/rollup bundles.
Alternatively, import it in your ES module supported browser with `import 'https://unpkg.com/obj-viewer?module';` in a JavaScript module file or in your HTML with ``. The demo page uses the latter method.
## Note
Because of a bug in the THREE.js's OrbitControls.js key down events on the embedded sites will not work.