Tuesday, April 16, 2013

Recycling

In Quartz Composer pursuits I've been playing with Collada files (which have a .dae file extension). I was relatively enthused about looking at them since they're just XML files, which are usually readable and therefore manipulable by simpletons but it turns out they're really big and complicated and annoying. For instance this download is the simplest possible cube I can make, spat out of Sketchup with all options turned off and Texture Mapping as the material choice, and dimwitted manual chopping after that. It's a fucking CUBE for god's sake, and if you open the .dae in a text editor it's 86 lines long with vertex information and a count of polygons - 48 of them from 0-47 - and so on. That seems like overkill, even though it's still less than half the line-length of the cube here. So the previous javascript in Quartz Composer wins for simple objects ...except that Javascript in Quartz Composer seems to like overpopulating its arrays so we limit the size with a method stolen, once again, from Kineme.

It turns out that once I figured out some of the logic of Collada files (this was a big help) I could paste information about Callista into one of those and end up with a relatively small file (~80kb) instead of the 8MB giants like this baby, but I don't yet understand how to fill out volume so she ends up as a set of menacing polygons:



Turn her in this direction and she's building material for witchy wheatfields:



Kineme also has some plugins that will spit arrays out into a plist...not sure why that was chosen but it does that, and from there we can do a smidge of TextWrangling and just paste vertex and colour information into a JavaScript structure from whatever we have around, that being Callista.

As Callista on her own, pushed into the same javascript module as that cube, she renders quickly and cleanly, disregarding my crappy vertex-order problems; the thing that was making my poor laptop fan try to become airborne and get outta there was just the process of parsing the initial PNG to do array population with (and also I had a pretty big window of data output so I could see where I was fucking up). So with that and some other things lying around...

VOILA!


Okay, you can just SHUT THE HELL UP.

Hmm...I wonder if I can actually salvage some kind of use out of an ambulatory—THERE SHE IS AGAIN! GET HER!

4 comments:

ifthethunderdontgetya™³²®© said...

Wow. Ann looks really scared now.
~

fish said...

Well I guess we can all see why Newt dumped his cancer ridden wife for this catch!

Smut Clyde said...

So basically you like Callista colladas?

Substance McGravitas said...

They're getting caught in my brain.