This is post is part of the ‘one threex a day’ challenge. This challenge is to publish every day one game extension for three.js! One per day, every day and that for 2month! In this post, we gonna talk about threex.crates. threex.crates is a threex game extension for three.js. It provides crates models, 3 of them to be accurate. Yeah you heard me, this is only boxes of wood. Why doing an extension for that? Well, because crates are like a myth in 3d graphics, we put them everywhere. So if you need crates to easily put in your game, you know where to find them now :)

To see the other posts about one threex a day and forget our moto! “A THREEx extension a day, gets your game on its way!”

Show Don’t Tell

examples/basic.html [view source] : It shows all the balls on a single screen.

How To Install It

You can install it via script tag

1 <script src= 'threex.crates.js' ></script>

Or you can install with bower, as you wish.

1 bower install threex.crates

How To Use It

To create a crate0, just do

1 2 var mesh = THREEx.Crates.createCrate0 () scene.add ( mesh )

To create a crate1, just do

1 2 var mesh = THREEx.Crates.createCrate1 () scene.add ( mesh )

To create a crate2, just do