
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
simple 3d boids class
based on this demo by takashi
no longer has a THREE.js dependency -- this lib only handles the positioning of the boids, not rendering meshes etc.
npm i boids-3d
var {Creature, BoidWorld} = require('boids-3d');
var theBoidWorld;
var creatureNum = 250;
var creatures = [];
var generateBoidWorld = () => {
for (let i = 0; i < creatureNum; i++) {
const creature = new Creature();
creatures.push(creature);
}
theBoidWorld = new BoidWorld(creatures);
//now we can update the creatures in the boidWorld with theBoidWorld.update();
}
generateBoidWorld();
//[optional] visualizing the boid world with ascii raytracer...
var art = require('ascii-raytracer');
var config = {
lines: creatures.map(function(c){
var line= [[c.mesh.position.x,c.mesh.position.y,c.mesh.position.z],[c.mesh.position.x,c.mesh.position.y,c.mesh.position.z]]
line.color = [1,0,0];
return line;
}),
resolution: 64,
aspectRatio: 1.0,
mouseControl:true,
cameraPos: [0,0,0]
}
art.runScene(config);
//update the boid world, update the lines displayed by ascii-raytracer
//each creature is prepresented by a line
setInterval(function(){
var s = 0.1;
var vs = 1.0;
var res = creatures.map(function(c){
var p = c.mesh.position;
var v = c.velocity;
var line = [
[p.x*s,p.y*s,p.z*s],
[p.x*s+v.x*vs,p.y*s+v.y*vs,p.z*s+v.z*vs]
];
line.color = c.color;
return line;
});
art.updateDfForLines(res,1);
theBoidWorld.update();
},10 );

FAQs
simple 3d boids class
The npm package boids-3d receives a total of 2 weekly downloads. As such, boids-3d popularity was classified as not popular.
We found that boids-3d demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.