Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
t3d.js is a web-first, light weight, extendable 3D rendering library.
Mostly inspired by three.js, but with improvements in the renderer and many implementation details.
Examples — Documentation — Discord
Use t3d.js
or t3d.min.js
in your page:
<script src="t3d.min.js"></script>
or import as es6 module:
import * as t3d from 't3d.module.js';
t3d is published on npm. To install, use:
npm install t3d --save
This will allow you to import t3d entirely using:
import * as t3d from 't3d';
or individual classes using:
import { Scene, Renderer } from 't3d';
After v0.1.2, the js files in examples/jsm
can be imported like this:
import { OrbitControls } from 't3d/examples/jsm/controls/OrbitControls.js';
Draw a simple cube:
const width = window.innerWidth || 2;
const height = window.innerHeight || 2;
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
document.body.appendChild(canvas);
const gl = canvas.getContext("webgl2", {
antialias: true,
alpha: false
});
const renderer = new t3d.Renderer(gl);
renderer.renderPass.setClearColor(0.1, 0.1, 0.1, 1);
const backRenderTarget = new t3d.RenderTargetBack(canvas);
const scene = new t3d.Scene();
const geometry = new t3d.BoxGeometry(8, 8, 8);
const material = new t3d.PBRMaterial();
const mesh = new t3d.Mesh(geometry, material);
scene.add(mesh);
const ambientLight = new t3d.AmbientLight(0xffffff);
scene.add(ambientLight);
const directionalLight = new t3d.DirectionalLight(0xffffff);
directionalLight.position.set(-5, 5, 5);
directionalLight.lookAt(new t3d.Vector3(), new t3d.Vector3(0, 1, 0));
scene.add(directionalLight);
const camera = new t3d.Camera();
camera.position.set(0, 10, 30);
camera.lookAt(new t3d.Vector3(0, 0, 0), new t3d.Vector3(0, 1, 0));
camera.setPerspective(45 / 180 * Math.PI, width / height, 1, 1000);
scene.add(camera);
function loop(count) {
requestAnimationFrame(loop);
mesh.euler.y = count / 1000 * .5; // rotate cube
scene.updateMatrix();
scene.updateRenderStates(camera);
scene.updateRenderQueue(camera);
renderer.renderPass.setRenderTarget(backRenderTarget);
renderer.renderPass.clear(true, true, false);
renderer.renderScene(scene, camera);
}
requestAnimationFrame(loop);
Use npm to build:
npm install
npm run build
FAQs
t3d.js is a lightweight, web-first, and extendable 3D rendering library.
The npm package t3d receives a total of 9 weekly downloads. As such, t3d popularity was classified as not popular.
We found that t3d demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.