
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
threeify is a Typescript 3D library loosely based on three.js.
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.
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 "./geometry/primitives/Box";
import { MaterialOutputs } from "./materials/MaterialOutputs";
import { PhysicalMaterial } from "./materials/PhysicalMaterial";
import { PerspectiveCamera } from "./nodes/cameras/PerspectiveCamera";
import { Mesh } from "./nodes/Mesh";
import { Node } from "./nodes/Node";
import { RenderingContext } from "./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() {
requestAnimationFrame(animate);
mesh.rotation.x += 0.01;
mesh.rotation.y += 0.02;
mesh.dirty();
canvasFramebuffer.render(scene, camera, true);
}
animate();
To run:
yarn
yarn dev
Then open a web server to the address displayed in the console. Usually this will be http://localhost:8000.
If you have docker and docker-compose available do:
docker-compose up -d
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.
FAQs
Typescript 3D Library loosely based on three.js
The npm package threeify receives a total of 33 weekly downloads. As such, threeify popularity was classified as not popular.
We found that threeify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.