Catalog npm
PACKAGE EXPLORERView in registry

9th.js

npm

WebGL 3D library for interactive scenes — scene graph, materials, lights, loaders, post-processing, and more

3dgltfgraphicsjavascriptmeshpbrrenderingscene-graphtypescriptvisualizationwebglanimationcameralibrarylightmaterial
All keywords (21)
shadertexturethree-dimensionalgame-enginethree.js
Versions collected35
Direct dependencies31From release 1.0.7
Last observed20 Oct, 21:42 UTC

README

Current package documentation

9th.js

A WebGL library for building interactive 3D scenes in the browser.

npm License: MIT

9th.js gives you a scene graph, cameras, meshes, lights, materials, loaders, and controls — so you can render 3D content with a clear, object-oriented API and ship it to the web.

Maintained by digitalcloud.

Features

  • Scene graph — Scene, Object3D, Mesh, hierarchy, transforms (Euler + quaternion)
  • Cameras — perspective and orthographic
  • Geometry — box, sphere, plane, and more → BufferGeometry
  • Materials — unlit and PBR (MeshBasicMaterial, MeshStandardMaterial, and related)
  • Lights — ambient, directional, point, spot
  • Picking — Raycaster + Mesh.raycast
  • Instancing — InstancedMesh for batched draws
  • Render targets — offscreen RenderTarget + composer-friendly renderer APIs
  • Extras — post-processing passes, tween helpers, game-loop utilities (experimental WebGPU preview)
  • Controls — OrbitControls for explore / inspect UIs
  • Loaders — GLTF, OBJ, and related asset pipelines
  • Engine helper — optional loop, pause/resume, and performance hooks
  • Builds — ESM + UMD, TypeScript typings on npm

Install

npm install 9th.js
yarn add 9th.js
pnpm add 9th.js

Quick start

import {
  WebGLRenderer,
  Scene,
  PerspectiveCamera,
  BoxGeometry,
  MeshBasicMaterial,
  Mesh
} from '9th.js';

const canvas = document.querySelector('#canvas');
const renderer = new WebGLRenderer({ canvas, antialias: true });
const scene = new Scene();
const camera = new PerspectiveCamera(60, innerWidth / innerHeight, 0.1, 100);
camera.position.set(0, 1.5, 4);

const cube = new Mesh(
  new BoxGeometry(1, 1, 1),
  new MeshBasicMaterial({ color: '#4fc3f7' })
);
scene.add(cube);

function frame() {
  requestAnimationFrame(frame);
  cube.rotation.y += 0.01;
  renderer.setSize(innerWidth, innerHeight);
  camera.aspect = innerWidth / innerHeight;
  camera.updateProjectionMatrix();
  renderer.render(scene, camera);
}
frame();

Lit scene + orbit

import {
  WebGLRenderer, Scene, PerspectiveCamera,
  BoxGeometry, MeshStandardMaterial, Mesh,
  AmbientLight, DirectionalLight, OrbitControls
} from '9th.js';

const canvas = document.querySelector('#canvas');
const renderer = new WebGLRenderer({ canvas, antialias: true });
const scene = new Scene();
const camera = new PerspectiveCamera(60, innerWidth / innerHeight, 0.1, 100);
camera.position.set(2, 2, 4);

scene.add(new AmbientLight(0xffffff, 0.35));
const sun = new DirectionalLight(0xffffff, 1.2);
sun.position.set(3, 5, 2);
scene.add(sun);

scene.add(new Mesh(
  new BoxGeometry(1, 1, 1),
  new MeshStandardMaterial({ color: '#4fc3f7', metalness: 0.2, roughness: 0.4 })
));

const controls = new OrbitControls(camera, canvas);

function frame() {
  requestAnimationFrame(frame);
  controls.update();
  renderer.setSize(innerWidth, innerHeight);
  camera.aspect = innerWidth / innerHeight;
  camera.updateProjectionMatrix();
  renderer.render(scene, camera);
}
frame();

CDN

<script src="https://unpkg.com/9th.js@1.0.7/dist/umd/9th.umd.min.js"></script>

Also on jsDelivr: https://cdn.jsdelivr.net/npm/9th.js@1.0.7/dist/umd/9th.umd.min.js

Examples

Live gallery (after npm run build, serve the repo root):

examples/ → open examples/index.html

Previews

Hello cubeLit + orbit
Hello cubeLit cube
Unlit MeshBasicMaterialPBR + lights + OrbitControls
PrimitivesMaterials
PrimitivesMaterials
Box, sphere, cylinder, coneMetalness / roughness row
LightsGLTF
LightsGLTF
Ambient + directional + pointsGLTFLoader → scene
npm run build
npx serve .
# open http://localhost:3000/examples/

Docs & roadmap

License

MIT © digitalcloud

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 35

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.7Registry latest24 Jul 202631
1.0.620 Jul 202631
1.0.519 Jul 202631
1.0.419 Jul 202631
1.0.319 Jul 202631
1.0.219 Jul 202631
1.0.119 Jul 202631
1.0.019 Jul 202631
0.1.2615 Nov 202536
0.1.2515 Nov 202536
0.1.2411 Nov 202536
0.1.2311 Nov 202536
0.1.2211 Nov 202536
0.1.2111 Nov 202536
0.1.2011 Nov 202536
0.1.1911 Nov 202536
0.1.1811 Nov 202536
0.1.1711 Nov 202536
0.1.1611 Nov 202536
0.1.1511 Nov 202536

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
9thjs/9th.js

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
syedrazaalino/9th.js

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
username/9th.js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:42 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:d80db89692cb0c006a83f5740c1583fa10ae013e94a50c5599dc4641c7f7be06