
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.
@3d-dice/dice-box-threejs
Advanced tools
A 3D environment for rolling game dice using threejs and cannon-es
3D Dice implemented with ThreeJS and Cannon ES
Based on Major's 3D Dice
The goal of this project is to decouple the UI of Major's 3D Dice and strip down the dice box to just the essentials. Just a module that accepts simple dice notation input and outputs a JSON object when the dice finish rolling.
Why another dice roller when you have @3d-dice/dice-box? Teall dice had already solved predeterministic rolling, which is a feature some developers really need. Major's 3D dice are based on Teall Dice.
https://codesandbox.io/s/dice-box-threejs-j79h35?file=/src/index.js
npm install @3d-dice/dice-box-threejs
const defaultConfig = {
framerate: (1/60),
sounds: false,
volume: 100,
color_spotlight: 0xefdfd5,
shadows: true,
theme_surface: "green-felt",
sound_dieMaterial: 'plastic',
theme_customColorset: null,
theme_colorset: "white", // see available colorsets in https://github.com/3d-dice/dice-box-threejs/blob/main/src/const/colorsets.js
theme_texture: "", // see available textures in https://github.com/3d-dice/dice-box-threejs/blob/main/src/const/texturelist.js
theme_material: "glass", // "none" | "metal" | "wood" | "glass" | "plastic"
gravity_multiplier: 400,
light_intensity: 0.7,
baseScale: 100,
strength: 1, // toss strength of dice
onRollComplete: () => {}
}
onRollComplete callback function when creating the Dice Boxconst Box = new DiceBox("#scene-container",{
onRollComplete: (results) => {
console.log(`I've got results :>> `, results);
}
});
document.addEventListener("rollComplete",(e => {
console.log(`I've got custom event results :>> `, e.detail);
}))
roll method. Just be sure the function this call is in is asyncsetTimeout(async () => {
const result = await Box.roll("6d6")
console.log('result :>> ', result);
}, 1000);
As mentioned previously, this project was forked for it's predeterministic rolling capability. The notation to roll your predetermined outcomes looks like this:
Box.roll("6d6@4,4,4,4,4,4") // rolls six dice that will land on 4's
In order to use textures or sounds, you will need to manually copy the assets out of the ./public folder and into your static assets folder where you're building your app.
FAQs
A 3D environment for rolling game dice using threejs and cannon-es
The npm package @3d-dice/dice-box-threejs receives a total of 902 weekly downloads. As such, @3d-dice/dice-box-threejs popularity was classified as not popular.
We found that @3d-dice/dice-box-threejs 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.