So let's say the top face is 1, front is 5, right is 4, back is 2, left is 3 and bottom is 6. As this image suggests .
I want to simulate a real die. I know the sum of opposite faces equals 7 (top: 1 + bottom:6 = 7). The real position matters for my code, so how do I randomize a die correctly? What I mean is, if the randomized result top is 1 and the front is 5, then the right side has to be 4. It can't be 3, because in a real die, the 3 would be in the left. Am I making myself clear? Please help me how would I do that. What really matters here is: Based on 2 faces, I get to know the third. Pseudocode is just fine, but if you can explain me just with text, I appreciate too ;)
Aucun commentaire:
Enregistrer un commentaire