bhouston/threeify
소개
A Typescript 3D library loosely based on three.js
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalthreeify
A Typescript library loosely based on three.js
threeify is a Typescript 3D library loosely based on three.js.
Feature overview:
- Modern: Typescript, Tree Shakable, Small Build Files
- Rendering: WebGL 2 and WebGPU (coming soon)
- Materials: Physically based materials
- Post Effects: DOF (coming soon), Motion Blur ((coming soon)), SOA (coming soon), TRAA (coming soon)
- Animation: Clips (coming soon), Mixer (coming soon)
- Assets: glTF (coming soon), Draco (coming soon) and Basis (coming soon)
- XR: Augmented Reality and Virtual Reality via WebXR (coming soon)
- Documented (TSDocs) and Tested (Jest)
Warning
In Development, Not Yet Ready for Use of Any Kind
This library is currently in alpha and in midst of significant development. It may not even compile properly. You have been warned.
Install and Import
Threeify and its modules are published on npm with full typing support. To install, use:
npm install threeify --save
Or
yarn add threeify
This will allow you to import Threeify entirely using:
import * as THREEIFY from 'threeify'; // NOT YET SUPPORTED
or individual classes using:
import { RenderContext, Vector3 } from 'threeify';
Usage
This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a WebGL renderer context for the scene and camera, and it adds that viewport to the document.body element. Finally, it animates the cube within the scene for the camera.
import { box } from '@threeify/geometry/primitives/Box';
import { MaterialOutputs } from '@threeify/materials/MaterialOutputs';
import { PhysicalMaterial } from '@threeify/materials/PhysicalMaterial';
import { PerspectiveCamera } from '@threeify/nodes/cameras/PerspectiveCamera';
import { Mesh } from '@threeify/nodes/Mesh';
import { Node } from '@threeify/nodes/Node';
import { RenderingContext } from '@threeify/renderers/webgl2';
const camera = new PerspectiveCamera(70, 0.01, 10);
camera.position.x = 1;
const geometry = box(0.2, 0.2, 0.2);
const material = new PhysicalMaterial();
material.outputs = MaterialOutputs.Normal;
const mesh = new Mesh(geometry, material);
const scene = new Node();
scene.children.add(mesh);
const context = new RenderingContext();
const canvasFramebuffer = context.canvasFramebuffer;
document.body.appendChild(canvasFramebuffer.canvas);
function animate(): void {
requestAnimationFrame(animate);
mesh.rotation.x += 0.01;
mesh.rotation.y += 0.02;
mesh.dirty();
canvasFramebuffer.render(scene, camera, true);
}
animate();
Development
Local Development Setup
To run:
Check out the git repository
git clone [email protected]:bhouston/threeify.git
Install dependencies
npm install
Run in watch mode
npm run dev
Start example server
npm run start -w=examples-server
Build for production
npm run build
Contributors
This project exists thanks to all the people who contribute.
License
관련 프로젝트 살펴보기
불러오는 중…