You can do it in many ways...what I did in my dice game was:
Imagine the dice with no rotation at all in any axis, and the number on top is for example ONE.
- If we rotate our dice 90º in x axis, our dice on top is FOUR.
- If we rotate -90º in x axis, our dice on top is SIX.
We are going to rotate the dice randomly in its three axis...
rotate object DICE ,90*RND(3),90*RND(3),90*RND(3)
So if we make all the combinations ( 6 sides by 3 axis ) we'll know which side is on top in every conbination.
Another way, perhaps easier...is to make our dice with six planes, and just check which limb is higher than...for example 3 (if your dice is let say 5*5 size ).
Now I'm out, and I don't have my code here...if you want I cand send it later.
Cheers.
I'm not a grumpy grandpa
