Gathering detailed insights and metrics for axis3d
Gathering detailed insights and metrics for axis3d
Gathering detailed insights and metrics for axis3d
Gathering detailed insights and metrics for axis3d
npm install axis3d
Typescript
Module System
Node Version
NPM Version
JavaScript (89.17%)
GLSL (8.75%)
Makefile (1.28%)
HTML (0.69%)
Shell (0.11%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
67 Stars
294 Commits
12 Forks
13 Watchers
11 Branches
5 Contributors
Updated on Jan 04, 2024
Latest Version
0.6.4
Package Id
axis3d@0.6.4
Size
146.14 kB
NPM Version
5.3.0
Node Version
7.10.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
29
39
Axis3D is a lightweight functional graphics library built on top of regl. It aims to be compatible with many components within the stack.gl ecosystem. It provides a set of components with sane defaults. It is not intended to replace existing libraries, but instead provide an alternative way for rendering graphics.
This library is heavily inspired by the underlying mechanics of regl and the functional/reactive component patterns introduced in react. The scene graph and transform state is implied by the declarative structure of the components.
Everything is a function that injects a regl context. Vectors and matrices are plain arrays that are compatible with gl-matrix and the like. Axis3D should feel familiar to three.js, but with less features.
Stable - This project is in active development towards 1.0.0
1$ npm install axis3d
1import { Geometry, Material, Context, Frame, Mesh } from 'axis3d' 2import { PerspectiveCamera } from 'axis3d/camera' 3import Bunny from 'bunny' 4import quat from 'gl-quat' 5 6// scale vertices along the `y-axis` down a bit 7for (const p of Bunny.positions) { p[1] = p[1] - 4 } 8 9const ctx = new Context() 10const rotation = quat.identity([]) 11const material = new Material(ctx) 12const camera = new PerspectiveCamera(ctx) 13const frame = new Frame(ctx) 14const bunny = new Mesh(ctx, {geometry: new Geometry({complex: Bunny})}) 15 16// requestAnimationFrame loop helper with context injection 17frame(scene) 18 19// the scene drawn every frame 20function scene({time}) { 21 quat.setAxisAngle(angle, [0, 1, 0], 0.5*time) 22 camera({rotation, position: [0, 0, 5]}() => { 23 material(() => { 24 bunny() 25 }) 26 }) 27}
The following are comparisons for effectively doing the same thing in Axis3D below.
1import { PerspectiveCamera, Context, Material, Frame, Mesh, } from 'axis3d' 2import { BoxGeometry } from 'axis3d-geometry' 3import quat from 'gl-quat' 4 5const ctx = new Context() 6 7const rotation = quat.identity([]) 8const geometry = new BoxGeometry({x: 10, y: 10, z: 10}) 9const material = new Material(ctx) 10const camera = new PerspectiveCamera(ctx, {fov: 60, near: 0.1, far: 1000}) 11const frame = new Frame(ctx) 12const mesh = new Mesh(ctx, {geometry}) 13 14frame(({time}) => { 15 quat.setAxisAngle(rotation, [0, 1, 0], 0.5*time) 16 camera({position: [0, 0, 5]}, () => { 17 material({color: [0, 0, 1]}, () => { 18 mesh({rotation}) 19 }) 20 }) 21})
1const aspect = window.innerWidth/window.innerHeight
2const near = 0.1
3const far = 1000
4const fov = 60
5
6const renderer = new THREE.WebGLRenderer()
7const geometry = new THREE.BoxGeometry(10, 10, 10)
8const material = new THREE.MeshBasicMaterial({color: 0x0000ff, wireframe: true})
9const camera = new THREE.PerspectiveCamera(fov, aspect, near, faar)
10const scene = new THREE.Scene()
11const mesh = new THREE.Mesh(geometry, material)
12
13camera.position.z = 5
14renderer.setSize(window.innerWidth, window.innerHeight)
15scene.add(mesh)
16document.body.appendChild(renderer.domElement)
17
18frame()
19function frame() {
20 requestAnimationFrame(frame)
21 mesh.rotation.y = 0.5*Date.now()
22 renderer.render(scene, camera)
23}
TBD
MIT
No vulnerabilities found.
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 1/7 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More