Wednesday, February 25, 2009

Smoothstep Interpolation with Arduino

I have a friend who is crazy about timelapse photography. Lately he has been experimenting with motion control camera equipment to make his shots more dynamic . Most of his gear is built from combining off the self components in different ways. Nick is wanting more control out of his devices. So I introduced him to the world of electronics and micro controllers.

Now we are endevouring to break some new ground in timelapse (at least for us ;) The first task I have been appointed with is to come up with a way to go from no camera motion to full camera motion in the smoothest possible way.

Below is a snippet of Arduino code utilizing the smoothstep function. I very powerful formula for smoothing the interpolation from one value to another. Also check out this post for a python example video of the same formula

Check out some of Nick's beautiful timelapse work at

For more info and pics on the smoothstep method check out this link. This code is also featured on the Arduino Playground Wiki in the Code Library and Tutorials Section

// Smoothstep Interpolation Example //

// Dan Thompson 2009
// Inpired by the code and chat on this site.
// Use this code at your own risk.
// This sketch was written with motion controlled timelapse photography
// in mind. I have tried to make it generic enough to understand the smoothstep
// concept so that one might adapt this powerful formula in other areas as well.
// For the full tutorial visit
// Usage:
// 1. Upload the sketch to the Arduino.
// 2. Click on the Serial monitor to see some visual feed back of the SMOOTHSTEP function.
// 3. Scroll throught the print out to see the SMOOTHSTEP curve.
// 4. Play with the code and addapt it to your needs! ;)

#define SMOOTHSTEP(x) ((x) * (x) * (3 - 2 * (x))) //SMOOTHSTEP expression.

int j = 0; //Just an Iterator.
int i = 0; //Just another Iterator.
float A = 0.0; //Input Min Value
float B = 100.0; //Input Max Value
float X; //final smoothstepped value
float v; //smoothstep expression variable
float N = 100.0; //number of steps

void setup() {
9600); //establish serial connection for debugging

void loop()
if (j < N) // Keep looping until we hit the pre-defined max number of steps
= j / N; // Iteration divided by the number of steps.
v = SMOOTHSTEP(v); // Run the smoothstep expression on v.
X = (B * v) + (A * (1 - v)); // Run the linear interpolation expression using the current smoothstep result.
for ( i=0; i < X ; i++) // This loop could the relevant code for each time your motor steps.
"1"); //Prints the number "1" for each step.
" "); //Puts a space between each line of steps and their corresponding float value
Serial.println(X); // prints the soothstepped value
Serial.println("CLICK!!!"); // this could be where you trigger your timelapse shutter
j++; // Increments j by 1.

Monday, February 9, 2009


This is my first real attempt at a sculpt in zBrush. I started this sculpt with zSpheres and so far it's been lots of fun. I used this video from Ryan Kingslien as reference. I hope to do this sculpt 3 times before I try a different body part.

More stuff from the First Light Vault

Digging around my old Hard Drive I found these pics.

An unfinished Solem Model.

A model sheet of Solem and RB7

Saturday, February 7, 2009

First Light Robot Designs

These were the initial sketches I did when trying to come up with some characters for the film.


A Very old Render of the first ever 3D character I modelled. This guy was made in a program called Animation Master. He is the villain from a clay animated short film I worked on years earlier. Here's a link to the film. The Adventures of Egg Cup Boy