Comments and answers for "Dice Rolling Detection"
http://answers.unity.com/questions/576654/dice-rolling-detection.html
The latest comments and answers for the question "Dice Rolling Detection"Answer by tWayfarer
http://answers.unity.com/answers/576660/view.html
You can get the collision's [contact points][1], and from there find the direction to from the centre to the collision point. You'll have to figure out in advance the direction to each face, which there's probably an elegant way of doing which I am unaware of. Rigidbody physics could probably handle rolling the die itself, after an initial force applied. Then, just wait until it's stopped, use the contact points to find the face on the bottom, compare the angle and you've got the face. If you want the opposite face to the one on the bottom, just reverse the angle before comparing it.
[1]: http://docs.unity3d.com/Documentation/ScriptReference/Collision-contacts.htmlSat, 16 Nov 2013 03:03:00 GMTtWayfarerComment by Huacanacha
http://answers.unity.com/comments/576685/view.html
If you need complete flexibility with die sizes, shapes, and number of faces, just check all faces for the normal closest in angle to Vector3.up once the die comes to rest. Using the Dot product this is very little calculation compared to, for example, having colliders on each face (likely more costly per set of calculations plus run each physics update).
Vector3.Dot(Vector3.up, side.normal); // Find the result closest to 1!
You need some meta-data for your sides in any case to define what number or result they represent, so just store the normal as well. It's probably best to pre-calculate the local space normal in Start() then transform Vector3.up to local space before calculating the dot products.
I'm not sure if this answers you fully so I'll leave it as a comment... are you also thinking how to deter$$anonymous$$e which faces are what value on the die etc?Sat, 16 Nov 2013 01:49:00 GMTHuacanacha