]]>http://www.conceptualinertia.net/aoakenfo/swift-candy-crush-clone/feed0how to make a unicornhttp://www.conceptualinertia.net/aoakenfo/how-to-make-a-unicorn
http://www.conceptualinertia.net/aoakenfo/how-to-make-a-unicorn#commentsMon, 15 Dec 2014 01:25:48 +0000http://www.conceptualinertia.net/aoakenfo/?p=837Continue reading how to make a unicorn]]>Managment: We need a unicorn, how long will it take to make one?

Artist: I’ve never drawn a unicorn before, I…

Management: Nevermind that, I need a number. Give me a breakdown of how long it will take to draw each body part.

Artist: Uhh…okay. 2 days for the head, 1 day for the body, 0.25 days for each of the limbs, I guess.

Management: Okay! I have you scheduled to draw four limbs before end of day. Tomorrow you can draw the head and finish off the week attaching the body to both.

Later that week…

Management: Shit, we forgot the tail. We should fix the alignment issues between the head and body but we’ve run out of time. Meh. Ship it.

]]>http://www.conceptualinertia.net/aoakenfo/metal-update/feed0wavefront OBJ file format parsing with bashhttp://www.conceptualinertia.net/aoakenfo/wavefront-obj-file-format-parsing-with-bash
http://www.conceptualinertia.net/aoakenfo/wavefront-obj-file-format-parsing-with-bash#commentsSat, 04 Oct 2014 06:56:22 +0000http://www.conceptualinertia.net/aoakenfo/?p=812Continue reading wavefront OBJ file format parsing with bash]]>Recently, I needed to extract some vertices from an OBJ file and drop them into my code. Rather than writing a OBJ file parser, I used bash to process the text. Here’s the OBJ file for a simple cube exported from Blender:

Nifty. I’ll likely extend it to extract additional data, compile to a custom binary format, and save it out to a shell script. After that I can call my make binary obj from either the command line or Xcode:

$ mbo cube.obj

Update:

Full script to create a binary OBJ file with an interleaved vertex buffer (v/n/uv).

]]>http://www.conceptualinertia.net/aoakenfo/wavefront-obj-file-format-parsing-with-bash/feed0swift curried functionshttp://www.conceptualinertia.net/aoakenfo/swift-curried-functions
http://www.conceptualinertia.net/aoakenfo/swift-curried-functions#commentsSun, 14 Sep 2014 08:35:04 +0000http://www.conceptualinertia.net/aoakenfo/?p=793Continue reading swift curried functions]]>Ran across this just now and found the comment by Pavol more interesting than curried functions. Yes Pavol! Totally. This is going to be a recurring problem for a lot of imperative programmers beginning to enter the world of functional programming through Swift. ‘Functional first’ is something I have to continually remind myself of. The original (imperative) gist went something like this:

Pavol advocates a more functional approach, without the “minutiae” of loops and temp vars:

Can we continue that train of functional thought? What if we move the separator up the chain, eliminating the function call:

That was an interim step to see if it worked. Now lets wrap it up and bring back that append function, allowing us to pass any separator:

Lastly, to make it even more compact, we can remove some syntax noise in the call to reduce:

]]>http://www.conceptualinertia.net/aoakenfo/swift-curried-functions/feed0the matrixhttp://www.conceptualinertia.net/aoakenfo/the-matrix
http://www.conceptualinertia.net/aoakenfo/the-matrix#commentsTue, 11 Mar 2014 05:55:17 +0000http://www.conceptualinertia.net/aoakenfo/?p=771In the process of trying to get an OpenGL snapshot working, I got this, which I thought was quite beautiful.