3D Dice using PV3D
Posted by Nate Chatellier on April 3rd, 2008Okay, so it’s actually one die not two dice (so far), but here’s the story. My employer is making a dice based game (which means I can’t release the source, sorry) that will be played on a touch screen. I whipped this little demo together fairly quickly using Papervision3D Great White.
But, I still have two major kinks to work out:
1. The rotation is not always accurate.
2. There are no true ground physics going on yet, so the dice can land on a corner.
Regarding (1): The way that the axis rotate in Papervision seems a bit odd to me. Try this:
-Slowly move your mouse “North” and note how the cube rotates.
-Now rotate the cube one face to the East or West
-Again, slowly move your mouse “North” and note how the cube rotates.
Repeat this process and you’ll notice that the axis itself gets rotated with the cube causing a different rotation to occur depending on which face is up. This makes sense, but the funny thing is, if you try to compensate for this by rotating it about the z-axis when certain faces are showing, you’ll notice that the z-axis does not seem to rotate, unlike the x and y-axis. Odd…
Regarding (2): The physics that are in it currently are basic “hack” physics that I wrote. I’m not (currently) using a full-fledged physics engine. The “bounce” that it has off of the ground is done with Tweener. I think I’m about to start evaluating using some real physics engines. I’m considering Box2DFlashAS3 or APE (Actionscript Physics Engine). Both of those are 2d engines so I’m not sure how much tweaking it would take for them to work in 3d. It looks like the WOW AS3 3D Physics Engine (which is based off of APE) does not yet support what I would need it for. The final option would be to convert the JBullet physics library from Java to AS3.
I think I will probably start with WOW, but let me know if you have any suggestions…







