This is a playable demo of the dice roller I blogged about. Click the button to roll the dice!

In this demo there is a checkbox to toggle determinism on and off. When it is off, the dice just roll randomly and ignore the sliders. When it is on, the dice will roll the slider values. Move the sliders to change the values that'll be rolled.


As explained on my blog (or more to the point, on the reddit threads linked from my blog) this trick is achieved in two steps: One, figure out which face will end up on top as soon as the roll starts. Two, modify the dice so that the desired face replaces the simulated face.

For that second step I had to do some clever 3D math, and what I came up with relies on the fact that the faces of a 6-sided die are all aligned with a coordinate axis. Thus, I doubt that math would work with the polyhedral dice used in roleplaying games.

However the first step did not rely on things being aligned with coordinate axes, and would thus work for something like a 10-sided die...


(model by tnRaro)

Published 3 days ago
StatusPrototype
PlatformsHTML5
Authorjhocking
GenreCard Game
Made withUnity
TagsDice, Physics, Unity

Leave a comment

Log in with itch.io to leave a comment.