{"id":45345306,"url":"https://github.com/olivier-w/inconnu","last_synced_at":"2026-02-21T11:08:10.604Z","repository":{"id":332998495,"uuid":"1129255426","full_name":"olivier-w/inconnu","owner":"olivier-w","description":"dice roller","archived":false,"fork":false,"pushed_at":"2026-01-17T06:50:50.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-17T07:10:48.112Z","etag":null,"topics":["randomizer"],"latest_commit_sha":null,"homepage":"https://olivier-w.github.io/inconnu/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olivier-w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-06T20:43:29.000Z","updated_at":"2026-01-17T06:50:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/olivier-w/inconnu","commit_stats":null,"previous_names":["olivier-w/inconnu"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/olivier-w/inconnu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivier-w%2Finconnu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivier-w%2Finconnu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivier-w%2Finconnu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivier-w%2Finconnu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olivier-w","download_url":"https://codeload.github.com/olivier-w/inconnu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivier-w%2Finconnu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["randomizer"],"created_at":"2026-02-21T11:08:09.945Z","updated_at":"2026-02-21T11:08:10.589Z","avatar_url":"https://github.com/olivier-w.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dice Roller\n\nA 3D dice roller with custom physics simulation supporting multiple dice types.\n\n\u003cimg width=\"767\" height=\"710\" alt=\"Screenshot 2026-01-06 154531\" src=\"https://github.com/user-attachments/assets/63048307-9f45-42d7-a4ca-a6cc0261dc5a\" /\u003e\n\n![Dice Roller](https://img.shields.io/badge/Three.js-0.160.0-black) ![No Build](https://img.shields.io/badge/build-none-green)\n\n## Features\n\n- ~~**6 dice types**: d4, d6, d8, d12, d20, and coin flip~~\n- **1-5 dice** at a time\n- **Realistic physics** with proper collision detection\n- **No build tools** required\n\n## Demo\n\nClick anywhere or press spacebar to roll. Select dice type and count using the buttons at the bottom.\n\n## Running Locally\n\n```bash\nbunx serve .\n```\n\nThen open the displayed URL in your browser.\n\n## How It Was Made\n\n### Modular Architecture\n\nThe codebase is organized into ES modules:\n\n```\njs/\n├── app.js              # Main application, scene setup, animation loop\n├── textures.js         # Canvas texture generation\n├── physics/            # Custom physics engine\n│   ├── physics-engine.js   # Fixed timestep simulation loop\n│   ├── rigid-body.js       # RigidBody class with quaternion rotation\n│   ├── collision.js        # Ground, wall, and dice-to-dice collisions\n│   ├── integrator.js       # Semi-implicit Euler integration\n│   └── constants.js        # Physics constants (gravity, restitution, etc.)\n└── dice-types/         # Config for each dice type\n    ├── d4.js           # Tetrahedron\n    ├── d6.js           # Cube with pips\n    ├── d8.js           # Octahedron\n    ├── d12.js          # Dodecahedron\n    ├── d20.js          # Icosahedron\n    └── coin.js         # Cylinder\n```\n\n### Rendering with Three.js\n\nThe 3D scene uses Three.js loaded via ES modules from CDN. Each dice type uses appropriate Three.js geometry:\n- ~~Built-in polyhedra geometries for d4, d8, d12, d20~~\n- RoundedBoxGeometry for d6 with canvas pip textures\n- CylinderGeometry for coin with Heads/Tails textures\n\nThe scene includes:\n- Directional lighting with soft shadows\n- Procedurally generated felt table texture\n- Fog and vignette effects\n- ACES filmic tone mapping\n\n### Custom Physics Engine\n\nA proper rigid body physics engine in `js/physics/`:\n\n**Fixed Timestep Simulation**\n- Runs at 240Hz for stability (accumulator pattern)\n- Semi-implicit Euler integration with velocity-squared drag\n- Decoupled from render rate\n\n**Collision System**\n- Vertex-based ground collision with impulse response\n- Wall collisions with bounce and spin\n- Dice-to-dice collision using sphere approximation for stability\n\n**Quaternion Rotation**\n- All rotations use quaternions to avoid gimbal lock\n- Proper angular momentum and torque\n\n**Settling Detection**\n- Tracks velocity and angular velocity thresholds\n- Timer-based settling (must be still for 0.3s)\n- Snaps to ground when settled\n\n### UI Design\n\nCasino-inspired aesthetic:\n- Cormorant Garamond serif font for results\n- Gold accents on dark green felt\n- CSS-only felt texture using SVG noise\n- Dice type selector with pill buttons\n\n## Technical Highlights\n\n- **Zero dependencies** to install\n- **~1000 lines** across modular files\n- **60 FPS** with fixed 240Hz physics timestep\n- **Extensible** - add new dice types easily\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivier-w%2Finconnu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folivier-w%2Finconnu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivier-w%2Finconnu/lists"}