Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-three

Package Overview
Dependencies
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-three

Angular Renderer for THREE.js

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
235
increased by186.59%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Renderer for THREE.js

Leverage your Angular to build 3D applications with THREE.js

Installation

npm i angular-three three
npm i -D @types/three

Typically, we'd want to keep three and @types/three on the same minor version. Eg: 0.147, 0.148 etc..

Simple usage

  1. Create a Scene component as a Standalone Component
import { extend } from 'angular-three';
import { Mesh, BoxGeometry, MeshBasicMaterial } from 'three';

extend({ Mesh, BoxGeometry, MeshBasicMaterial });

@Component({
    standalone: true,
    template: `
        <ngt-mesh>
            <ngt-box-geometry />
            <ngt-mesh-basic-material color="darkred" />
        </ngt-mesh>
    `,
    schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class Scene {}
  • 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..
  • Custom Element tags follow this rule: ngt- + THREE classes in kebab-case. Mesh -> ngt-mesh
  • schemas: [CUSTOM_ELEMENTS_SCHEMA] allows us to use custom tags on the template. This is Angular's limitation at the moment
  1. Render <ngt-canvas> component, use Scene component above to pass into [sceneGraph] input on <ngt-canvas>
<ngt-canvas [sceneGraph]="Scene" />
  • ngt-canvas creates the basic building blocks of THREE.js: a default WebGLRenderer, a default Scene, and a default PerspectiveCamera

Documentations

Read more about Angular Three usages in Documentations

Contributions

Contributions are welcomed

Keywords

FAQs

Package last updated on 24 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc