From CSclasswiki
Jump to: navigation, search


This special studies has two main parts. First, to help Professor Joseph O'rourke with his research in mathematics and animation of pop-up cards. Second, to create several 3D animations yet to be written.

Professor O'Rourke will write code in Mathematica that will result in a basic graphic of a pop-up card. The purpose of this project is to take those results and import them into Blender and create a nicer looking and more complete animation.

Pop-Up Research

First Import Tests

Blooming Cube

Blooming Cube
Blooming Cube

Mathematica and Blender both support import and export of 3D graphics in many formats. There are nine possible formats to go from Mathematica to Blender (3DS, DXF, LWO, OBJ, OFF, PLY, STL, VRML, X3D). Starting with the BloomingCube.nb Mathematica file that Professor O'Rourke has written of a cube unfolding to a 2D shape, I have started to try each of these formats to see which will work best.

First I had to figure out how to export into any of those formats. Using the Export command in Mathematica, I have modified the Blooming Cube code to export 20 3D graphics files of the specified format.

The first format I tried to use was OFF (Object File Format) because it is a well-established format and is very common, but when I tried to open these files in Blender I got a null pointer error from Python.

I next tried OBJ because it is almost universally used and is very simple. I successfully imported nine 3D graphics of stills of the unfolding cube that I used to make an animation. From here there are I have thought of two ways to animate; using layers and using armatures. (See Using Layers and Using Armatures)

For the next tests I tried exporting as X3D because it is the ISO standard for 3D graphics. Unfortunately, the import fails and prints an Attribute Error: 'list' object has no attribute 'array_data'. I will look into X3D format more later to see how this can be fixed.

I also tried LWO. It was made for LightWave 3D, a high-end computer graphics software that include some advanced animation features. It imported fine and I added the same kind of armature as I had for the OBJ import. The side connected to the top and bottom of the cube warps a little as does the one oppisite of it. I expect that this is because their bones are slightly off center. Moving them to more precisely center should help that.

Fourth animation: Cube Animation

Since OBJ format works fine right now. I will not be trying any other formats until I need to do something that OBJ format cannot.

Using Layers

The simpler method and the one I tried first is to move each piece to the first layer in order of the unfolding. This is simpler because it does not involve trying to pose the cube without warping the shape. The downside to this is that is much slower to animate, and does not allow any movement outside of what was done in Mathematica.

First Animation

The first animation is not to fancy. I have added a texture to show what Blender can do that Mathematica cannot.

The first animation: Cube Animation

Using Armatures

The other option is to import one 3D Graphic of the cube and try to pose it to see the animation. To do this I have added an armature to the cube. It works very well for all but the top piece of the cube. As the bone rotates to flatten the shape, this piece rotates as it should, but also shortens as it rotates. It also warps one corner of the side it connects to. These flaws may have to do with being the only piece attached to another moving piece. All other sides are only attached to the bottom which never moves.

Second Animation

In the second animation, I show how the armature makes for a smoother animation. It also allows the shape to be rotated as it unfolds.

Second animation : Cube Animation

Third Animation

The reason the top side and the side attached to it were being warped is because the bone attached side had been weighted to control the top side as well as its own side. Once this was fixed, the cube moved as it should.

Thirds Animation : Cube Animation

Other Possibilities for Import

MathGL3d 4.1

Mathematica has an OpenGL based add-on called MathGL3d 4.1 that includes real-time interaction, animation, textures and light source and camera control. That would make it unnecessary to export and import as every step could be done from one setting.


POVRay is a free ray tracing program for 3D graphics. Mathematica can also export to POV format so import would be fairly easy. Katie is working on this possibility while I focus on Blender.



An armature is a kind of 3D graphics skeleton. It is made of individual bones that are connected to each other and then matched to one or more meshes. How much control any one bone has over each part of a mesh is controlled through weight painting in which the object is color coded to show how much control the specified bone has over it.

Other Animation Projects

I have three other animation projects that I'm currently working on.



Most complicated is an animation of a pair of semi-photo-realistic hands preparing food in a kitchen. I am building up the kitchen little by little and have started adding in the last details. I need to make some of the textures more realistic and add utensils. The animation itself has not started.

The latest render of the kitchen (Render on the right) is almost complete. The latest additions are a glass window, though nothing can be seen through it and a sink with a faucet.

The right hand is completed. A very basic animation of it opening, drumming fingers on a surface and closing is completed and up for viewing here. There are very minimal visible flaws with them other than the fact that the fingers are rather thin.

I have decided to change the hand into a white glove to keep things simpler.


I also have what I call "ragdolls" that are simple stick figures that I am using to learn more about armatures, weight painting and most anything I'd like to learn about. The current animation that I am working on is two of the ragdolls ballroom dancing together.

Through the ragdolls, I have started looking at particle systems.

The first completed ragdoll video is 10-seconds long and is the first animation I made using an armature to control the object. Some distortion is visible where the ragdoll's arms move. More recent ragdoll work feature ragdolls with a short covering of fur that hides any distortion (see still renders below)

Plain Ragdolls Furry Ragdolls

The most recent completed ragdoll video is also 10-seconds long, but will be at least 30-seconds before it is complete. Two ragdolls do a simple dance with just a plane as a floor. The next version of this video will have more setting (textured floor and walls) and a less harsh angle of light.

Update 12/19:

The latest render is 19 seconds long, and now has a setting. They are now on a toy shelf at night. There is also a 5 second introduction before they dance. The 19-second animation took around 5 hours to render. I will run another render later tonight which will hopefully be 30-45 seconds and will take around 10 hours to render.

The final animation is 45 seconds long, took 9 hours to render and you can see it here.


Lucian is the first character I made. He is an evil bubble pipe-smoking lizard who likes to play pool. I tried animating him before I knew how to make armatures, so there are clear flaws in the animation (View animation). I plan to add an armature and make a few animations staring Lucian.

Blender Research Resources