|
|
2年前 | |
|---|---|---|
| .github/workflows | 3年前 | |
| .idea | 3年前 | |
| examples | 3年前 | |
| plugins | 3年前 | |
| src | 3年前 | |
| .eslintignore | 3年前 | |
| .eslintrc.cjs | 3年前 | |
| .gitignore | 3年前 | |
| .npmignore | 3年前 | |
| LICENSE | 2年前 | |
| NOTICE | 2年前 | |
| README.md | 2年前 | |
| package-lock.json | 3年前 | |
| package.json | 3年前 | |
| rollup.config.mjs | 3年前 | |
| tsconfig.json | 3年前 | |
| typedoc.json | 3年前 | |
A new way to work with three.js, 3D models and rendering on the web.
ThreePipe — Github — Examples — API Reference — WebGi
ThreePipe is a 3D framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.
Key features include:
Code samples and demos covering various usecases and test are present in the examples folder.
Try them: https://threepipe.org/examples/
npm install threepipe
First, create a canvas element in your HTML page:
<canvas id="three-canvas" style="width: 800px; height: 600px;"></canvas>
Then, import the viewer and create a new instance:
import {ThreeViewer, IObject3D} from 'threepipe'
// Create a viewer
const viewer = new ThreeViewer({canvas: document.getElementById('three-canvas') as HTMLCanvasElement})
// Load an environment map
await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
// Load a model
const result = await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', {
autoCenter: true,
autoScale: true,
})
That’s it! You should now see a 3D model on your page.
The 3D model can be opened in the editor to view and edit the scene settings, objects, materials, lights, cameras, post-processing, etc. and exported as a GLB file. All settings are automatically serialized and saved in the GLB file, which can be loaded into the viewer. Any plugins used in the editor can be added to the viewer to add the same functionality. The plugin data is automatically loaded(if the plugin is added) when the model is added to the scene.
The viewer initializes with a Scene, Camera, Camera controls(Orbit Controls), several importers, exporters and a default rendering pipeline. Additional functionality can be added with plugins.
Check out the GLTF Load example to see it in action or to check the JS equivalent code: https://threepipe.org/examples/gltf-load/
The core framework(src, dist, examples folders) and any plugins without a separate license are under the Apache 2.0 license.
Some plugins(in the plugins folder) might have different licenses. Check the individual plugin documentation and the source folder/files for more details.
The project is in alpha stage and under active development. Many features will be added but the core API will not change significantly in future releases.
Check out WebGi for an advanced tailor-made solution for e-commerce, jewelry, automobile, apparel, furniture etc.
Check the list of all functions, classes and types in the API Reference Docs.
Check out WebGi - Premium Photo-realistic 3D rendering framework and tools for web applications and online commerce along with custom modules and rendering solutions for e-commerce, jewelry, automobile, apparel, furniture and other retail applications.
Contributions to ThreePipe are welcome and encouraged! Feel free to open issues and pull requests on the GitHub repository.