PolyDice is a high-performance, 100% self-contained JavaScript 3D polyhedral dice simulation library. It requires zero external image files or 3D asset downloads—all 9 polyhedral meshes, UV projections, and high-resolution normal maps with engraved numerals are synthesized mathematically at runtime.
| Die | Geometry | Faces | Reading Rule |
|---|---|---|---|
d4 |
Regular Tetrahedron | 4 Equilateral Triangles | Opposite apex (bottom face flat) |
d6 |
Regular Hexahedron (Cube) | 6 Squares | Top face normal (+Y) |
d8 |
Regular Octahedron | 8 Equilateral Triangles | Top face normal (+Y) |
d10 |
Pentagonal Trapezohedron | 10 Kites | Top face normal (+Y) |
d12 |
Regular Dodecahedron | 12 Regular Pentagons | Top face normal (+Y) |
d14 |
Heptagonal Trapezohedron | 14 Kites | Top face normal (+Y) |
d16 |
Octagonal Bipyramid | 16 Isosceles Triangles | Top face normal (+Y) |
d20 |
Regular Icosahedron | 20 Equilateral Triangles | Top face normal (+Y) |
d24 |
Deltoidal Icositetrahedron | 24 Kites | Top face normal (+Y) |
d30 |
Rhombic Triacontahedron | 30 Golden Rhombi (ratio φ) | Top face normal (+Y) |
d48 |
Disdyakis Dodecahedron | 48 Scalene Triangles | Top face normal (+Y) |
d60 |
Pentakis Dodecahedron | 60 Isosceles Triangles | Top face normal (+Y) |
d100 |
Zocchihedron (Dual Spherical Lattice) | 100 Spherical Facets | Top face normal (+Y) |
d120 |
Disdyakis Triacontahedron | 120 Scalene Triangles | Top face normal (+Y) |
0.0, Subtle:
0.05, Round: 0.10). Exported .glb models need no vertex-merging
when imported into Blender or game engines!
qOffset, and replays with 100% authentic tumbling
physics without mid-air steering..glb 3D model export.PolyDice is structured as a standalone, zero-asset ES6 module (polydice.js) taking
THREE and Ammo dependencies in its constructor, with backward-compatible aliases
on window.
This pre-formatted Markdown provides complete architectural, mathematical, and API context for ingestion into Large Language Model prompts, autonomous agents, and documentation generators.
Drop this snippet into your application, web game, or VTT to initialize PolyDice with your exact active pool, materials, and edge bevels:
Target roll strings allow webhooks, Discord bots, or server game backends to command predetermined roll outcomes:
"2d20: 20, 1" • "d20: 18; 2d6: 6, 5" •
"d100: 99"diceEngine.rollPredeterminedDice(diceTypes, targetValues, power)
Inspect or edit your active configuration JSON below. Click Apply Config to Scene to instantly re-theme and reconfigure the live simulation:
?dice=4d6,2d20&theme=emerald
Themes: obsidian, gold, silver, ruby, emerald, sapphire, pearl, cyber, paladin