angular-three 1.0.0-beta.4 → 1.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -4
- package/esm2020/index.mjs +2 -1
- package/fesm2015/angular-three.mjs +1 -1
- package/fesm2015/angular-three.mjs.map +1 -1
- package/fesm2020/angular-three.mjs +1 -1
- package/fesm2020/angular-three.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,58 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Angular Renderer for THREE.js
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Leverage your [Angular](https://angular.io) to build 3D applications with [THREE.js](https://threejs.org)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```shell
|
|
8
|
+
npm i angular-three three
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
npm i -D @types/three
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> Typically, we'd want to keep `three` and `@types/three` on the same minor version. Eg: `0.147`, `0.148` etc..
|
|
16
|
+
|
|
17
|
+
## Simple usage
|
|
18
|
+
|
|
19
|
+
1. Create a `Scene` component as a Standalone Component
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { extend } from 'angular-three';
|
|
23
|
+
import { Mesh, BoxGeometry, MeshBasicMaterial } from 'three';
|
|
24
|
+
|
|
25
|
+
extend({ Mesh, BoxGeometry, MeshBasicMaterial });
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
standalone: true,
|
|
29
|
+
template: `
|
|
30
|
+
<ngt-mesh>
|
|
31
|
+
<ngt-box-geometry />
|
|
32
|
+
<ngt-mesh-basic-material color="darkred" />
|
|
33
|
+
</ngt-mesh>
|
|
34
|
+
`,
|
|
35
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
36
|
+
})
|
|
37
|
+
export class Scene {}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- `extend` will add the THREE entities to `angular-three` catalogue which allows the renderer to recognize the custom tags: `ngt-mesh`, `ngt-box-geometry` etc..
|
|
41
|
+
- Custom Element tags follow this rule: `ngt-` + THREE classes in **kebab-case**. `Mesh` -> `ngt-mesh`
|
|
42
|
+
- `schemas: [CUSTOM_ELEMENTS_SCHEMA]` allows us to use custom tags on the template. This is Angular's limitation at the moment
|
|
43
|
+
|
|
44
|
+
2. Render `<ngt-canvas>` component, use `Scene` component above to pass into `[scene]` input on `<ngt-canvas>`
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<ngt-canvas [scene]="Scene" />
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- `ngt-canvas` creates the basic building blocks of THREE.js: a default `WebGLRenderer`, a default `Scene`, and a default `PerspectiveCamera`
|
|
51
|
+
|
|
52
|
+
## Documentations
|
|
53
|
+
|
|
54
|
+
Read more about Angular Three usages in [TBD Documentations]()
|
|
55
|
+
|
|
56
|
+
## Contributions
|
|
57
|
+
|
|
58
|
+
Contributions are welcomed
|
package/esm2020/index.mjs
CHANGED
|
@@ -7,7 +7,8 @@ export * from './lib/stores/store';
|
|
|
7
7
|
export * from './lib/stores/rx-store';
|
|
8
8
|
export * from './lib/utils/instance';
|
|
9
9
|
export * from './lib/utils/update';
|
|
10
|
+
export * from './lib/utils/is';
|
|
10
11
|
export * from './lib/loader';
|
|
11
12
|
export * from './lib/di/ref';
|
|
12
13
|
export * from './lib/di/destroy';
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItdGhyZWUvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSw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,5 @@ function injectNgtRef(initialValue = null) {
|
|
|
2561
2561
|
* Generated bundle index. Do not edit.
|
|
2562
2562
|
*/
|
|
2563
2563
|
|
|
2564
|
-
export { NGT_CATALOGUE, NgtArgs, NgtCanvas, NgtCanvasContainer, NgtRepeat, NgtRxStore, NgtStore, checkNeedsUpdate, checkUpdate, extend, getLocalState, injectNgtDestroy, injectNgtLoader, injectNgtRef, invalidateInstance, prepare, rootStateMap, startWithUndefined, updateCamera };
|
|
2564
|
+
export { NGT_CATALOGUE, NgtArgs, NgtCanvas, NgtCanvasContainer, NgtRepeat, NgtRxStore, NgtStore, checkNeedsUpdate, checkUpdate, extend, getLocalState, injectNgtDestroy, injectNgtLoader, injectNgtRef, invalidateInstance, is, prepare, rootStateMap, startWithUndefined, updateCamera };
|
|
2565
2565
|
//# sourceMappingURL=angular-three.mjs.map
|