This demo was made shortly after the initial release of Jiglib. It was a study of how far you can push realism in the sence of rendering and animation. Here CompositeMaterial is used with a BitmapMaterial and a GouraudMaterial. This is much faster then using a ShadedMaterial. All you need to do is modify the GouraudMaterial to use a transparent light map. Andy Zupko’s ShadowCaster is used for casting the die shadows. Jiglib is used for the 3D physics, also slightly modified to facilitate fixed timestep. Unfortunatelly the end result is still far from the desired 60fps. Hit spacebar too see the stats, check it out.
UPDATE: Something troubled me when checking the performance in the browser with Flash Player 10 compared to Flash Player 9. On my machine FP9 ran at approx 40fps but FP10 hardly reached 25fps. Changing the wmode from “direct” to “normal” fixed the performance issue in FP10. Especailly in Firefox the performance difference is significant. Still on my machine FP9 seems to perform slightly better then FP10. Mental note: next time take more care in setting the proper wmode.

June 11, 2009 at 5:42 am |
its awesome,
i still on development too to build the dice simulation with jiglib. Anyway i have a problem to get the value of the dice ? any idea or clue to get the number of the dice?,that i should have fixed integration-time to replicate the movement exactly so i can determine the value on the first time?
thx:)
June 11, 2009 at 6:45 am |
i just solve the problem ,thx u , anyway your experiment compilation its awesome
July 8, 2009 at 9:11 am |
Indra, how you solve this problem?, if it’s possible can you explain me please. servarium@gmail.com
October 22, 2009 at 1:10 pm |
This is great! Is the source available anywhere?
October 22, 2009 at 7:19 pm |
Hi Chris,
Thanks for your enthousiasm! However, I’m not going to release the complete code of this demo since apart from the artwork and implementation there’s not much new here. It’s all existing open source libraries put together. This demo just shows that with some hard work it’s possible for everybody to make and in the article it’s described what you need to do to get the same results I got. But try it your own way and chances are you might get a better result.
The only piece of code I’ll share is the transparent GouraudMaterial I mention in the article. You can get it here:
http://www.barcinski-jeanjean.com/entries/dice/download/GouraudTransparentMaterial.as
Good luck and let me know how it worked out.
Ciao,
Adrien
November 26, 2009 at 2:04 pm |
Great!! Check out my newest game where I used pv3d+jiglib, its a helicopter simulation: http://www.littlebigplay.com/game/548
December 14, 2009 at 4:11 pm |
A BIG thanks for this shader solution!!! Saved my mental health
Beautiful and fast! Thanks for sharing it!
As a quick note: the gouraudMap variables namespace needs to be changed to public in the GouraudMaterial.as…
March 9, 2010 at 12:21 pm |
Jiglib has me mired often, largely because of these aforementioned performance issues and the lack of decent documentation.
I am still very optimistic about it though and the dice run very well.