npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ngx3js-assets

v0.134.0-2021112516

Published

Angular & Javascript 3D library

Readme

ngx3js

NPM Package NPM Downloads

Angular & Javascript 3D library

The aim of the project is to create an easy to use, lightweight, cross-browser, general purpose 3D library in angular. The current builds only include a WebGL renderer but WebGPU (experimental), SVG and CSS3D renderers are also available in the examples.

ExamplesDocumentationAPI Documentation

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 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.

To Install you can choose one from two method.

Ngx3js Install - Method 1 - Recommanded

# install shell script
npm install -g @angular/cli
npm install ngx3js
node ./node_modules/ngx3js/bin/patch.js
npm install 

Ngx3js Install - Method 2

# install by npm
npm install -g @angular/cli
npm install ngx3js
npm install [email protected]
npm install --save-dev @types/[email protected]
npm install gsap
npm install lil-gui
npm install chroma-js
npm install --save-dev @types/chroma-js
npm install fs
npm install fs-web

Auto Formater - optional

# prettier format change
npx prettier --write src/**/*.json
npx prettier --write src/**/*.ts
npx prettier --write src/**/*.html
npx prettier --write src/**/*.scss

Imports Ngx3JsModule - Required

To use ngx3js have to import Ngx3JsModule in src/app/app.module.ts or some other place modle.ts

// src/app/app.module.ts

import { Ngx3JsModule } from 'ngx3js';

@NgModule({
	....
	imports: [..., Ngx3JsModule],
	....
})

Change Default Assets Url - optional

If you chhange assets in angular.json file must be setted!

// src/app/app.component.ts

import { ThreeUtil } from 'ngx3js';

export class AppComponent {
	ngOnInit(): void {
	  // any where use ngx3js for just one time
	  ThreeUtil.setAssetUrl('assets/examples/');
	}
}

Change angular.json for basic assets

if you need lottie_canvas add "node_modules/ngx3js/assets/js/libs/lottie_canvas.js" to scripts like below. the assets url can be changed by your site.

// angular.json

{
  "projects": {
    "your-project-name": {
      "architect": {
        "build": {
          "options": {
            "allowedCommonJsDependencies" : [
              "fs"
            ],
            "assets": [
                {
                    "glob": "**/*",
                    "input": "./node_modules/ngx3js/assets",
                    "output": "/assets/examples/"
                }
            ],
            "scripts": [
              "node_modules/ngx3js/assets/js/libs/lottie_canvas.js"
            ] 
          },
        },
      }
    }
  },
}

Change tsconfig.json for fs

// tsconfig.json

{
  "compilerOptions": {
    "paths": {
      "fs": ["./node_modules/fs-web"]
    }
  }
}

Add Code to your template

<!-- src/app/app.component.html -->
<div style="width: 700px; height: 500px; display: block; position: relative">
  <ngx3js-renderer
    [controlType]="'orbit'"
    [controlOptions]="{
      enablePan: false,
      enableDamping: true,
      minDistance: 10,
      maxDistance: 500
    }"
    [statsMode]="0"
    [antialias]="true"
    [clearColor]="'0x000000'"
    [shadowMapEnabled]="true"
  >
    <ngx3js-lookat [x]="0" [y]="0" [z]="0"></ngx3js-lookat>
    <ngx3js-camera
      [type]="'perspective'"
      [fov]="40"
      [near]="1"
      [far]="1000"
      [viewport]="true"
      [x]="0"
      [y]="0"
      [width]="'100%'"
      [height]="'100%'"
    >
      <ngx3js-position [x]="-50" [y]="0" [z]="50"></ngx3js-position>
    </ngx3js-camera>
    <ngx3js-scene #scene>
      <ngx3js-light [type]="'AmbientLight'" [color]="'0x6688cc'"></ngx3js-light>
      <ngx3js-light
        [type]="'directional'"
        [color]="'0xffffff'"
        [intensity]="1"
        [castShadow]="true"
      >
        <ngx3js-position [x]="-3" [y]="10" [z]="-10"></ngx3js-position>
      </ngx3js-light>
      <ngx3js-mesh>
        <ngx3js-position [x]="0" [y]="0" [z]="0"></ngx3js-position>
        <ngx3js-geometry
          [type]="'Icosahedron'"
          [radius]="20"
          [detail]="2"
        ></ngx3js-geometry>
        <ngx3js-material
          [type]="'meshlambert'"
          [color]="'0xffffff'"
          [wireframe]="true"
        ></ngx3js-material>
      </ngx3js-mesh>
      <ngx3js-mesh>
        <ngx3js-position [x]="0" [y]="0" [z]="0"></ngx3js-position>
        <ngx3js-geometry
          [type]="'TextGeometry'"
          [text]="'Ngx3Js'"
          [font]="'gentilis_regular'"
          [size]="20"
          [height]="5"
          [center]="true"
        ></ngx3js-geometry>
        <ngx3js-material
          [type]="'meshlambert'"
          [color]="'0xff0000'"
        ></ngx3js-material>
      </ngx3js-mesh>
    </ngx3js-scene>
  </ngx3js-renderer>
</div>

Cloning this repository

Cloning the repo with all its history results in a ~2 GB download. If you don't need the whole history you can use the depth parameter to significantly reduce download size.

ngx3js-module

git clone --depth=1 https://github.com/outmindkjg/ngx3js-module.git
cd ngx3js-module

ngx3js - examples and api docs

ngx3js module required to be reinstall.

git clone --depth=1 https://github.com/outmindkjg/ngx3js.git

cd ngx3js
npm uninstall ngx3js && npm install ngx3js
node ./node_modules/ngx3js/bin/patch.js

Releases & ISSUE & Ask Question