Announcing: "Walk Cycle Depot" blog

With a deep bow of acknowledgment to Jamaal Bradley's wonderful Pencil Test Depot , I have started a sub-section of Academy of Art Animation Notes devoted to collecting various Walk Cycles,  called  "Walk Cycle Depot".

I'll be posting walk cycles animated by pros and by students.

Here's an example of what you'll find there:

Max walk cycle from Cat's Don't Dance:


(I'm trying to post all Walk Cycles as Quicktime movies so it's possible to step through them frame-by-frame.   The embedded Quicktimes tend to load and play better in the CHROME browser or  FIREFOX browser.   If the playback is too choppy download them to your computer to view directly in Quicktime Player for better playback quality)

I'll try to update it frequently.   Check out the Walk Cycle Depot.

More Kinect Hacking

Some very amusing Kinect hacks from Robert Hodgin. When people first started hacking with the Microsoft Kinect, the projects were very technical in nature. These videos show some very cool creative possibilities.

The difference in the Kinect sensor apart from a normal camera is that it captures z-information, allowing you to use the scene in three dimensions. This allows you to affect each three dimensional point in space.

Body Dysmorphic Disorder from flight404 on Vimeo.


Fat Cat from flight404 on Vimeo.


These were coded with the open source framework Cinder. Cinder is a visual framework written in C++ and can be used for creating visual apps of all types.


Dueling Kinects from flight404 on Vimeo.

Two Kinects running at the same time. Each depthmap is compared and the closer value is kept. Allows for the creation of mutant hybrids, arms coming out of stomachs, etc.

"Jumping Through Hoops: The Animation Job Coach" by Tony White


At the recent CTN Expo in Burbank (great event , by the way) I was pleased to finally meet animator/author/teacher  Tony White face to face.

Among other interesting projects that Tony has in the works he has recently completed and released yet another book  titled "Jumping Through Hoops: The Animation Job Coach".

The book is a much needed guide for all those who want to get a first job in the animation industry.  It is also a valuable asset for all those who want to stay there once they have that all-important first job.     I read it cover-to- cover on my return flight home , and I highly recommend it to all students.    This is a very practical guide to preparing yourself for the modern animation industry and seeking a job once your animation training is completed.

(*Note: I will say that if I had a small quibble with the book it is to point out that the book needed more careful proofreading before publishing as there are a number of typographical errors,  but these in no way detract from the overall value of the wisdom contained in the covers of this book .  Just something that should be fixed in the second printing of the book.  Get the book. )

Hacked Roomba Uses MS Kinect to See The World, React to Gestural Input (video)



KinectBot’s software is hacked together just as much as its hardware. Robbel used simultaneous localization and mapping (SLAM) code from OpenSLAM.org (specifically GMapping) as well as some visualization packets from Mobile Robot Programming Toolkit (MRPT). He added his own interaction, human detection, and gesture code so that KinectBot could follow signed commands. As all of this is pretty much open (MRPT is GNU GPL, GMapping is Creative Commons, and Robbel’s own code isn’t anything MIT needs to keep proprietary) there’s a chance the software package will be available at some point for you to download.

The future of 3D vision hacking is bright!

Sensing when the mouse is inside a rectangle with Processing

int buttonSize = 100;

void setup()
{
size(300, 300);
}

void draw()
{
button(0, 0, buttonSize, buttonSize); // top left
button(width - buttonSize, 0, buttonSize, buttonSize); // top right
button(0, height - buttonSize, buttonSize, buttonSize); // top right
button(width - buttonSize, height - buttonSize, buttonSize, buttonSize); // top right
}

void button( int x, int y, int w, int h )
{
// if mouse is inside rectangle
if ( mouseX >= x && mouseX <= x+w &&
mouseY >= y && mouseY <= y+h) {

if (mousePressed) {
fill(255, 0, 0); // the color if the mouse is pressed and over the button
}
else {
fill(255, 255, 0); // the color if the mouse is over the button
}

}
else {
fill(0, 0, 255); // the color if the mouse is not over the button
}

rect(x, y, w, h);
}

How to Install a Library in Processing, using OpenCV as an Example

Libraries are extremely useful as they are developed for a specialized purpose, letting you solve more complex problems. OpenCV is an extensive open source computer vision library that allows you to track faces, objects, and other things seen by a camera. It focuses mainly towards real-time image processing. It allows you to all sorts of things that require camera tracking -- Such as tracking a faces, bodies, or movements.

To install OpenCV, you need to install the library. Follow these steps to install a library for Processing.

1. Download, unzip, and move the OpenCV Processing Library from here.

2. Option-click the Processing app in your Applications folder and click Show Package Contents



3. Browse to Contents/MacOS/Resources/Java/libraries/ and drop the OpenCV folder into it.



4. Re-Open Processing and try this really cool real-time motion-blender code from Andy Best.:

/**
Title: Processing Tutorials: Getting started with Video Processing via OpenCV
Author: Andy Best
Author URL: http://www.andybest.net/
Requires:
Processing http://processing.org
OpenCV http://opencv.willowgarage.com/wiki/
Processing Library http://ubaa.net/shared/processing/opencv/
*/

import hypermedia.video.*; // Imports the OpenCV library
OpenCV opencv; // Creates a new OpenCV Object
PImage trailsImg; // Image to hold the trails
int hCycle; // A variable to hold the hue of the image tint

void setup()
{

size( 320, 240 );

opencv = new OpenCV( this ); // Initialises the OpenCV object
opencv.capture( 320, 240 ); // Opens a video capture stream
trailsImg = new PImage( 320, 240 ); // Initialises trailsImg
hCycle = 0; // Initialise hCycle
}

void draw()
{

opencv.read(); // Grabs a frame from the camera
PImage camImage; // Creates an image and
camImage = opencv.image(); // stores the unprocessed camera frame in it

opencv.absDiff(); // Calculates the absolute difference
opencv.convert( OpenCV.GRAY ); // Converts the difference image to greyscale
opencv.blur( OpenCV.BLUR, 3 ); // I like to blur before taking the difference image to reduce camera noise
opencv.threshold( 20 );

trailsImg.blend( opencv.image(), 0, 0, 320, 240, 0, 0, 320, 240, SCREEN ); // Blends the movement image with the trails image

colorMode(HSB); // Changes the colour mode to HSB so that we can change the hue
tint(color(hCycle, 255, 255)); // Sets the tint so that the hue is equal to hcycle and the saturation and brightness are at 100%
image( trailsImg, 0, 0 ); // Display the blended difference image
noTint(); // Turns tint off
colorMode(RGB); // Changes the colour mode back to the default

blend( camImage, 0, 0, 320, 240, 0, 0, 320, 240, SCREEN ); // Blends the original image with the trails image

opencv.copy( trailsImg ); // Copies trailsImg into OpenCV buffer so we can put some effects on it
opencv.blur( OpenCV.BLUR, 4 ); // Blurs the trails image
opencv.brightness( -20 ); // Sets the brightness of the trails image to -20 so it will fade out
trailsImg = opencv.image(); // Puts the modified image from the buffer back into trailsImg

opencv.remember(); // Remembers the current frame

hCycle++; // Increments the hCycle variable by 1 so that the hue changes each frame
if (hCycle > 255) hCycle = 0; // If hCycle is greater than 255 (the maximum value for a hue) then make it equal to 0
}

Video

Processing OpenCV Tutorial Video #1- Psychedelic Blur! from Andy Best on Vimeo.

Introduction to GIT

Git is a free and open source, distributed revision control system, also commonly referred to as a version control system, designed to handle everything from small to very large projects with speed and efficiency. When developing code, A revision control system is useful in code because it acts as a method to share your code updates with a group, and keep track of your changes. It's a history of all your code work, and allows you to non-destructively edit your project without breaking it.

Version Control? Why do I need to use it>


Some of the best reasons:

  • It provides one method for an entire team to use; everybody operates under the same rules.
  • Changes are orderly vs. chaotic, saving development time
  • The ability to track changes promotes accountability, allowing you to contact the specific person who made an update.
  • A list of exact changes made can be viewed, making it easier to advise users of the information on how it has changed from version to version.
  • It gives you the ability to UNDO your changes!

Git's homepage: http://git-scm.com/. Git itself is an open source project that has been active for several years and is written mostly in C.

If you are new to coding, using GIT might feel like it's making your learning process more complex. But as you get used to using the command line and GIT, your code skill will become much stronger. Using a revision control system when coding allows you to jump into other open source projects with ease, and allows you to communicate the changes you're making to the group.

In order to use Git, you'll need to use the Terminal (on OSX). You can open the terminal by navigating to /Applications/Utilities/Terminal.

When setting up Git on a computer for the first time, here's some helpful commands to remember.

This is how you create a new Git project. Replace 'myproject' with your project name. 'mkdir' means you're creating a new directory, and 'cd' means you're moving to that directory. Typing 'git init .' means you're initializing a Git repository in the current directory.

mkdir myproject
cd myproject
git init .

Set up your name and email:
git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com

Use colors in Git:
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

Add your files:
git add .

View your project status:
git status

Commit your changes:
git commit -m "A message about what I changed"

View your commit log:
git log


A helpful Git tutorial

Learning how to use Git properly takes a lot of patience, as it's like learning another language in addition to the language of your code. It is a VERY powerful tool. If you're stuck -- ask questions! It will begin to make much more sense as you become familiar and use it consistently. We'll be using it to share code and projects in our class.

Reporters and Data

Most journalists [possess] daily computer skills that include Internet searches, word processing, and maybe some basic calculations in Excel, none of which enables journalists to truly mine large collections of data. Meanwhile, the amount of raw data available to journalists has mushroomed. At the federal level, the Obama administration’s “open government” initiative has given rise to new sources like Data.gov, a website devoted to the aggregation and easy dissemination of national data sets. State and local governments have followed suit, making much of the data they collect available online. More elusive tranches of data have been pried loose by nonprofit organizations courtesy of the Freedom of Information Act; an inquisitive journalist can download them in minutes. “I’m constantly amazed and surprised about what’s out there,” said Thomas Hargrove, a national correspondent for Scripps-Howard News Service who often leads data-based research projects for the chain’s fourteen newspapers and nine television stations.

via Serious Fun with Numbers

Programming is useful in all fields, even journalism. Very interesting article on data visualization, programming, and reporting. A reporter who knows how to disseminate large datasets into a database might be able to understand and derive more useful information than one who can't. That is, if the data is legitimate. There is potential for a dataset to be skewed in one way or another, and it's the reporters responsibility to fact-check just as they would any other reference or source.

Shape Revolver Function

A "Shape Revolver" function written in Processing. This function revolves a shape around a center point with a specified number and circle radius.

/**
* Shape Revolver
* @author Gabriel Dunne
* @description Revolves a repeating shape around a vertex
* @param int _x the X position
* @param int _y the Y position
* @param int sides the number of sides
* @param float radius the radius
*/
void shapeRevolver(int _x, int _y, int sides, float radius) {
for ( int i = 0; i < 360; i += (360 / sides) ) {
float x = _x + sin(radians(i)) * radius;
float y = _y + cos(radians(i)) * radius;
pushMatrix();
translate(x, y);
rotate(atan2(y - _y, x - _x));
// draw your shape here
rect(0,0,20,20);
//
popMatrix();
}
}
Related Examples:http://processing.org/learning/basics/triangleflower.html

Polygon Function

Polygon Function

// polygon function

void setup() {
size(600, 600);
smooth();
}

void draw() {
background(0);
noStroke();
fill(255);

polygon(100, 100, 5, 40);
polygon(200, 100, 6, 40);
polygon(300, 100, 7, 40);
polygon(100, 300, 7, 40);
polygon(200, 300, 3, 40);
polygon(300, 300, 8, 40);
}

void polygon(int _x, int _y, int sides, float radius) {

if (sides <= 0)
sides = 1;

beginShape();
for ( int i = 0; i < 360; i += (360 / sides) ) {
float x = _x + sin(radians(i)) * radius;
float y = _y + cos(radians(i)) * radius;
vertex(x, y);
// ellipse(x, y, 2, 2);
}
endShape();
}

Array Trails

A bit of code to create trails with the mouse using Arrays

int num = 60;
float mx[] = new float[num];
float my[] = new float[num];
float size[] = new float[num];

void setup() {
size(400, 400);
strokeWeight(10);
smooth();
}

void draw() {
background(0);
fill(255);
noStroke();

int which = frameCount % num;
mx[which] = mouseX;
my[which] = mouseY;
size[which] = abs(mouseX-pmouseX) + abs(mouseY-pmouseY);

for (int i = 0; i < num; i++) {
int index = (which+1 + i) % num;
ellipse(mx[index], my[index], size[index], size[index]);
}
}