1.6.5 • Published 4 months ago

atft v1.6.5

Weekly downloads
297
License
MIT
Repository
github
Last release
4 months ago

GitHub repo CI build status Known Vulnerabilities Code coverage by codecov.io npm version Storybook link

Angular Template For Three.js (atft)

Leverage Three.js in your Angular app using simple components:

<atft-orbit-controls [rotateSpeed]=1 [zoomSpeed]=1.2>
  <atft-renderer-canvas>
    <atft-perspective-camera
      [fov]=60 [near]=1 [far]=1100
      positionX=20 [positionY]=50 [positionZ]=50>
    </atft-perspective-camera>
    <atft-scene>
      <atft-axes-helper [size]=200></atft-axes-helper>
      <atft-grid-helper [size]=100 [divisions]=10></atft-grid-helper>
    </atft-scene>
  </atft-renderer-canvas>
</atft-orbit-controls>

Storybook

Explore provided Angular components in isolation!

Click below to see the demo in a web browser:

Goals of this repo

  • Implement npm atft library
    • Bindings for Three.js
    • SceneComponent with basic usage of scene, camera, lights, helpers, renderer
    • Integrated Three.js examples as components (e.g. OrbitControls, OBJLoader, ObjectLoader)
  • Develop and test library components in isolation via Storybook

Usage in your Angular project

  1. Set up an Angular project and install dependencies:
    npm i three dagre atft yaml --save
    npm i @types/dagre @types/three --save-dev
  2. Import library into your module:
    import { AtftModule } from 'atft';
    ...
      imports: [
        ...
        AtftModule
      ]
     ...
  3. Use atft library components in src/app.component.html:
    <atft-orbit-controls [rotateSpeed]=1 [zoomSpeed]=1.2>
      <atft-renderer-canvas #mainRenderer>
        <atft-perspective-camera
          [fov]=60 [near]=1 [far]=1100
          [positionX]=20 [positionY]=50 [positionZ]=50>
        </atft-perspective-camera>
        <atft-scene>
          <atft-axes-helper [size]=200></atft-axes-helper>
          <atft-grid-helper [size]=100 [divisions]=10></atft-grid-helper>
        </atft-scene>
      </atft-renderer-canvas>
    </atft-orbit-controls>
  4. (optionally) if you want to fit 3D scene canvas into entire screen (horizontally and vertically):

    in src/styles.css:

     html, body {
         height: 100%;
         margin: 0;
     }  

    in src/app/app.component.css:

     :host {
         height: 100%;
         display: flex;
     } 

Used by

Sample vect project, which is based on atft library:

Development

Build Library

  1. git clone https://github.com/makimenko/angular-template-for-threejs.git
  2. npm install
  3. ng build atft

Run Tests

  • npm test

Run Storybook

Run and watch locally: npm run storybook

Our storybook config is in ./storybook and our stories in ./src/stories. See the official Storybook.js documentation for more information.

API Documentation

For mode details see API documentation

Release and Changelog

To automatically generate changelog and bump atft version:

npm run release

Contributors

Feel free to join us! Just submit your ideas via pull-requests :)

1.6.5

4 months ago

1.6.4

5 months ago

1.6.3

5 months ago

1.6.2

5 months ago

1.5.4

5 months ago

1.5.3

5 months ago

1.6.1

5 months ago

1.6.0

5 months ago

1.5.2

5 months ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.22

3 years ago

1.4.21

3 years ago

1.4.23

3 years ago

1.4.20

3 years ago

1.4.17

3 years ago

1.4.19

3 years ago

1.4.18

3 years ago

1.4.16

3 years ago

1.4.15

3 years ago

1.4.14

3 years ago

1.4.11

3 years ago

1.4.13

3 years ago

1.4.12

3 years ago

1.4.10

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.1

4 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago