Test 1: Animated 3d mesh.
dropbox.com/s/b1u15kjc0b3vgyh/objAnimation2.capx
Tool capx to convert a 3d animation from many obj files to an array json:
dropbox.com/s/m2lw100wf0fqmkr/objAnimation2json.capx
This is yet another 3d test in c2. The main feature is it is a distorted mesh animation. The idea came about from some recent 3d tests on discord. Loading a simple 3d file format like .obj is simple enough but there is no good simple alternative for a 3d animation. Sure there are .dae .fbx and .glb, but they aren't as simple load.
This example is done by saving an animation to multiple obj files, then the tool capx is used to fill an array with just the vertex locations for every frame. That is loaded faster in the main capx, not to mention is a bit more compact. Then it's a matter of lerping the vertices from one frame to another to animate.
There are two modes in the capx controlled by the QUADDRAW constant. When off(or 0) the capx will just draw the animation as a wire frame, which is slower, but should work in C3 since it doesn't do anything fiddly.
With it on it utilizes mostly javascript to do the drawing and transformation of points. The drawing hijacks an objects drawing function and just uses c2's renderer to draw lots of quads. Other than that the rest is just to make transforming all the vertices faster than doing it via events.
Notes:
* There is a pause when it starts as it loads the animation json and parses one object file to get the faces and texture coordinates. The obj parsing can probably be made quicker and maybe cleaner by dropping it into js. As is the most useful speedup was avoiding tokenat to get each line of the file.
* The javascript used reaches into the c2 runtime and won't work after minifying unfortunately.
Anyways, this whole thing probably isn't useful for anything but it may be fun for someone to play around with and get some ideas.
I'll see if i can add to this topic other c2 related tests as i come up with them,
-cheers