How to roll the dice?


(kEinStein) #1

I asked this casually in someone elses thread, but now I’ve started to resume an older game I was doing. Let’s see if someone has a good idea how to realize the following: Take a normal 6-sided dice and put it on a table. Then roll it over one edge on another side. Repeat this a few times. My question is now - how to animate this in Blender on a keystroke and track the value on top after each step?


(gargola) #2

oops! edited…that was not your question.LOL :wink:


(kEinStein) #3

Hehe! But what have you written? I’m open to anything that might be helpful! :smiley:


(Tonberry) #4

Well… I’m not an expert of the GameEngine but I like to post!
How about create a cube then separate each side and parent to an empty in the middle. Name the sides “side1”, “side2” depending on the dice-value. Then add a touch sensor on the floor for each side that could recognize which side is on the floor and the opposite side would be the value…
Well you said you’re open for any ideas. 8)


(kEinStein) #5

Thanks for your answer. I am still open for any help because even if some answers don’t really solve the problem, they still can point me the right way to solve it! :wink:
But that matches not really the problem and would be quiet harder to animate. I try to explain it a little better. The problem is not really to track the value - this can I track through python so far (just rotating two lists should do so, I believe - didn’t think about it much right now, but I already had a solution for that 2 years ago, but none for the animation). I want to animate the dice rolling over an edge, over and over, in four directions - but it should always match the logical value (visible value == logical value). The problem so is more the animation. I wasn’t able to animate it by IPOs - and for sure it would be lotta work if I would create for each possible position of the dice and each direction a separate animation (if I am right there are 6^4 possibilities - there would have to be 1296 animations - that can’t be the way for such a “simple” task!)… :o :-? :frowning:
More ideas?!


(bmax) #6

what does blender have a physics engine for? :-?


(kEinStein) #7

There is no use of the physics engine for what I want. I don’t want to throw dices out of a dice-box, I want to roll it over once over an edge - or call it flip over the edge. If I only had direct access to the matrix of the object then it wouldn’t be that complicated. But there must be another way to achieve that kind of behaviour. The physics engine would be nice if you want to throw dices.