Sprite3D.js: a javascript library for 3D positionning
minimal.be
minimal.be
My company just launched a new mobile panorama viewer based on similar ideas, though we did our own super-minimal sprite3D to support our needs.
The really fun thing is that you can wire up the iPhone 4 and iPad 2 gyroscope to it to control the camera, makes for quite a demo :)
// then scramble
var r1, r2;
for( i = 0; i < numpieces>>1; i++ )
{
exchange( Math.random() * numpieces >> 0, Math.random() * numpieces >> 0 );
}
Easily enough fixed by just "manually" sliding a random piece adjacent to the hole a couple thousand or so times, but yeah... Making any sort of game, no matter how simple, is harder than you think :\I'm not a big fan of thin API wrappers like this. Why not dispense will all that code and let your library users access the underlying properties and methods instead? The library would be smaller, simpler, and faster.