Posted 11 months ago

Tinkering with POV-Ray

Ray tracers make it easy to generate an image by simulating how light bounces around in three dimensional space. POV-Ray is a particularly sophisticated ray tracer that can be used for the low, low price of $0.00. Go ahead, take a look. The rest can wait.

Cool, isn’t it?! You may have noticed that POV-Ray translates special text files into images. There’s no visual editor for drawing anything with your mouse. Instead you focus on describing the objects in the 3D scene through text. Sure, not being able to draw on a viewer and see pixels react immediately may seem less than ideal, but the input text can be rather expressive.

To give you an idea of what a basic input file looks like, here’s some source code that I stole from the early parts of the documentation.

#include "colors.inc"

camera {
  location <0, 2, -3>
  look_at <0, 1, 2>
}

sphere {
  <0, 1, 2>, 2
  texture {
    pigment { color Yellow }
  }
}

light_source { <2, 4, -3> color White }

Notice I had to specify a camera, sphere, and light_source. POV-Ray can simulate light bouncing off the sphere and into the camera. Now here’s a rendering produced by POV-Ray after processing the above text.

That was just a simple example. A quick look at the hall of fame on the POV-Ray website should be enough to realize the power of this software.

Posted 11 months ago

A good friend of mine showed me this video.  Hope it makes you smile :)

Posted 12 months ago

The Implementation of Functional Programming Languages

While I was running with my coworker today he got me interested in the implementation details of functional languages.  In particular, he described how functional programs can be thought of as a graph of nodes and edges.  The program is executed by taking this graph through several reductions until only a single node remains.

Might as well take a look at Simon Peyton Jones’ explanation of the G-machine.

Posted 12 months ago

Universal remote control?  Psh, just make an API for all your electronics accessible over the internet!