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 🙏

© 2024 – Pkg Stats / Ryan Hefner

threeify

v2.1.0

Published

Typescript 3D Library loosely based on three.js

Downloads

211

Readme

threeify is a Typescript 3D library loosely based on three.js.

Feature overview:

  • Modern: Typescript, Tree Shakable, Small Build Files
  • Rendering: WebGL 1, WebGL 2 (coming soon) and WebGPU (coming soon)
  • Materials: Physically based materials
  • Post Effects: DOF (coming soon), Motion Blur ((coming soon)), SOA (coming soon), TRAA (coming soon)
  • Animation: Clips (coming soon), Mixer (coming soon)
  • Assets: glTF (coming soon), Draco (coming soon) and Basis (coming soon)
  • XR: Augmented Reality and Virtual Reality via WebXR (coming soon)
  • Documented (TSDocs) and Tested (Jest)

Commitizen friendly

Warning

In Development, Not Yet Ready for Use of Any Kind

This library is currently in alpha and in midst of significant development. It may not even compile properly. You have been warned.

Install and Import

Threeify and its modules are published on npm with full typing support. To install, use:

npm install threeify --save

Or

yarn add threeify

This will allow you to import Threeify entirely using:

import * as THREEIFY from "threeify"; // NOT YET SUPPORTED

or individual classes using:

import { RenderContext, Vector3 } from "threeify";

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

import { box } from "@threeify/geometry/primitives/Box";
import { MaterialOutputs } from "@threeify/materials/MaterialOutputs";
import { PhysicalMaterial } from "@threeify/materials/PhysicalMaterial";
import { PerspectiveCamera } from "@threeify/nodes/cameras/PerspectiveCamera";
import { Mesh } from "@threeify/nodes/Mesh";
import { Node } from "@threeify/nodes/Node";
import { RenderingContext } from "@threeify/renderers/webgl2";

const camera = new PerspectiveCamera(70, 0.01, 10);
camera.position.x = 1;

const geometry = box(0.2, 0.2, 0.2);
const material = new PhysicalMaterial();
material.outputs = MaterialOutputs.Normal;

const mesh = new Mesh(geometry, material);

const scene = new Node();
scene.children.add(mesh);

const context = new RenderingContext();
const canvasFramebuffer = context.canvasFramebuffer;
document.body.appendChild(canvasFramebuffer.canvas);

function animate(): void {
  requestAnimationFrame(animate);

  mesh.rotation.x += 0.01;
  mesh.rotation.y += 0.02;
  mesh.dirty();

  canvasFramebuffer.render(scene, camera, true);
}

animate();

Development

Local

To run:

  1. Check out the git repository
  2. Install node.js & npm as appropriate for your platform.
  3. Run npm install to install all the required node modules from package.json
yarn
  1. To run the automatic typescript builder and dev server go:
yarn dev

Then open a web server to the address displayed in the console. Usually this will be http://localhost:8000.

Docker Compose

If you have docker and docker-compose available do:

docker-compose up -d

Theia-IDE

threeify supports the theia-ide so you can start coding immediately. theia-ide is available at http://localhost:3000. Perform step 3 and 4 in the theia-ide terminal.

Contributors

This project exists thanks to all the people who contribute.

License

ISC