This article is about the entire process and creation of a mechanical clock animation in Autodesk Maya. I created this clock animation and article, as an exam project during a 3D introductory course at the IT-University of Copenhagen in 2013. Watch the finalised 3D clock animation below.
Where it all began
I love clocks! These fantastic timekeepers are without a doubt one of mankind’s greatest innovations. The mechanical clock especially, has influenced society in unprecedented manners, right from the earliest mechanical clocks, which dates all the way back to the 14th century. Back then, these things where huge contraptions who relied on bells to tell the time. The fun however, really started in the 16th century, when the spring-driven mechanical clocks were invented. The spring made it possible to manufacture small and portable clocks. In fact, the development of the steam engine and thus the industrial revolution, were explicitly made possible by the precision engineering of the mechanical clock (Scientific American, 2012).
Although not quite as old as the clock, 3D graphics is quite fascinating too. Allegedly, the first digital 3D rendered film was produced as late as 1972 (Nerdplusart, 2011). Of course a lot has happened since then, but the basic principles and techniques introduced in this movie still remains the basis for the kind of 3D rendering, which is done in video games and movies today. What makes 3D special is the way objects can be simulated with its twists, bends and surfaces whilst appearing in a perspective view. The fact that you can generate realistically looking animations from simple bits (ones and zeros), is nothing short of an amazing achievement. This article is about the creation of a 3D animation featuring the mechanical clock in all of its wonderful glory. The presented combination of the old technology of mechanical clocks and the modern capabilities of 3D animation is my personal celebration of both of these wonderful technologies.
What I find especially fascinating about mechanical clocks is the perfect orchestration of the many cogwheels and parts working in perfect unison. I guess these mechanics are just appealing to the engineering- geek inside of me.
This fascination and interest for the mechanical clock originally stems from a web project I created for the Danish Watchmaker School some years ago. During this project I got to play around with some clockworks and I was introduced to some truly amazing 3D animations created by the German watch producer A. Lange & Söhne (L&S). Figure 1 shows a screenshot from some of these animation movies.
I think the animations from Lange & Söhne are quite inspirational since they contain a lot of complex moving parts and stunning texturing. Right from the get go, I knew I wanted to create a presentation type animation in the same style as L&S’s i.e. a short animation with all the focus aimed directly towards the mechanical elements of the timepiece. In essence, I wanted a neutral setting where the only thing, which matters was the clock on display. The purpose of my final animation is meant for web-based presentations – quite thinkable for educational purposes or perhaps just for a general presentation of the model.
For a novice like myself, trying to create something as comprehensive as the above renditions would obviously have been mission impossible. Of course, I did not realize this until after I started researching for timepiece blueprints. Such timepieces are actually insanely complex pieces of engineering. Therefore I chose to aim a bit lower and go for a very simple clockwork type of model. However, given the complexity and interplay of cogwheels I would still need a reference in order make the final animation turn like a real clockwork. So, I have used a screenshot of a 2D animation from a functioning online clock. Figure 2 shows the screenshot reference, which I imported as an imageplane into Maya.
This clockwork is of course quite simple, but most importantly is the fact that the proportions and number of cogs on each cogwheel is true to reality. This means the final animation look realistic, since the individual cogwheels will rotate at the correct speed ratio. In the following, I will go through the workflow process of modeling, animating lighting and rendering involved in creating the animation film for this clock.
The first decision to make before the modeling process begins, is deciding what kind of geometry type to use. This requires knowledge about how the model will be used later, since the typology affects the behavior of the model down the line (Alias, 2007). There are four basic types of geometry: NURBS, Subdivisions, curves and polygons. Since polygons are by far the most forgiving geometry to work with, these are the ones I am using.
Non-organic shapes such as the mechanical parts of a clockwork are good to build with polygons since it is easy to manipulate the edges, vertices and faces, which together makes up the polygon mesh. During the modeling phase I used the box modeling technique, which means manipulating primitive shapes by extruding, scaling or rotating faces and edges as well as welding pieces together, and bridging gaps and holes with polygon faces. The basic shapes I used during the modeling of the cogwheels were the polygon pipes and cylinders. Figure 3 shows an example of the process involved when extruding faces in order to create the center part of a cogwheel.
The process of modeling the cogwheels was quite straightforward and did not pose any major problems. However I made the mistake of modeling all the cogwheels in their entirety. When working with symmetrical shapes such as these, a much faster approach would have been to model half of the wheel and use the mirror geometry tool. I guess extruding all those cogs was just my moment of zen. Well – you live and prosper. As the amount of shapes increased in the scene, I started to rely more and more on the outliner and the layers editor. Figure 4 shows the grouping of the different cogwheels in the outliner and the distribution across different layers. I think a good organization like this is quite essential for maintaining a proper overview of the scene. Furthermore the parent/child relationships I created at this point would become useful during the animation phase.
According to my initial strategy for the project, I did not plan on adding more to the model beyond this point since the purpose was to showcase the clockwork and not a complete clock model. However, I felt the cogwheels were a little out of context without an actual watch casing to frame the cogwheels. So, I decided to create a casing for the clockwork. Since I did not have any reference for a casing I modeled it by free hand. Figure 5 shows the casing in the early stage.
Since I still wanted to maintain focus on the actual clockwork I left the backside of the casing open. Furthermore, in order to accentuate the clockwork I added the gap to expose some of the cogwheels. I think this works quite well and gives the model a unique character. All in all I am happy with this compromise.
Books could be written about typology, which is a quite advanced topic, but also an essential part of digital 3D modeling. Typology refers to the mesh structure of the model and ties directly to the edgeloops, which defines the model. In general, good typology allows for greater detail in the model. Furthermore it defines how well the model animates and how easy it deforms (Blender Cookie, 2010). Figure 6 shows the three typical types of typology which defines the faces in terms of the edgeloops i.e. triangles, quads and n-gons.
As a general rule of thumb, triangles and n-gons should always be avoided. When creating a model, the best approach is usually to aim for quads. But this depends on the purpose of the model. Good typology is especially essential when doing stuff like character animation where the character deforms. Gaming engines however, will convert everything to triads; so working with quads for this purpose is a waste of time.
Figure 7 shows an example of using the face split tool to clean up the resulting n-gon, after bridging edges and filling the hole in the center of the cogwheel.
In the case of my model I have tried to keep the triangles to a bare minimum, but the model still contains a few. In my case, since the actual model will not deform during the animation, this is of lees concern.
Manipulating the movements of three- dimensional objects over time is the trademark of telling a story through computer animation. In fact the term animate means ‘to give life to’. With the possibility of placing the objects at different distances from the viewer and moving them at different speeds, with respect to each other, a true experience of “moving perspective” can be achieved (Cazzie, 2012). But animation is obviously not just about moving objects around like lab rats on amphetamines. According to McLaren there must be some greater meaning and purpose with the animation:
Animation is not the art of drawings that move, but the art of movements that are drawn; What happens between each frame is much more important than what exists on each frame; Animation is therefore the art of manipulating the invisible interstices that lie between the framesMcLaren, cited in Furniss, 2007, 5
In the case of my clock animation, the narrative is quite simple, since the essence is on presenting the revolving mechanics of the watch as a celebration to this fantastic piece of engineering. Therefore I wanted to increase the speed of the cogwheels and pointers in order to demonstrate the mechanical interplay of the actual clockwork. Furthermore, the fixed placement of the clock on the turning pedestal is a classic technique of presenting objects and is often used by jewelers and within the car industry. Maya offers several different techniques and tools for the creation of animations. These include methods such as keyframe animation, nonlinear animation, path animation, dynamic animation and expressions (Keller, 2010). The keyframe animation technique is perhaps the easiest method and allows transforming objects over time by setting keyframes. But why rely on using keyframing when you get the chance to produce code?
Animating with expressions
With background knowledge in programming, it was a natural step for me to explore the animation expressions of Maya. Animation with expressions simply means writing formulas for the animation in the expression editor, which Maya then turns into action upon playtime. Expressions can save a lot of time when it comes to manipulating simple mechanical objects such as the clockwork. Furthermore expressions make it possible to precisely control the rotation speed of each individual cogwheel. This is quite essential since the cogwheels must – like real clockwork – rotate in relative speeds to one another. Although the math is probably quite simple, I actually had a hell of a time calculating the correct speed ratio of these cogwheels.
Expressions can essentially be written for anything with keyable attributes. As illustrated below, the actual expression involved in the rotation of a cogwheel is quite simple:
cog_big_min.rotateZ = time * 6.6;
This syntax is very simple. The first part refers to the object being manipulated; in this case it is the group cog_big_min, which I created during the modeling phase. As illustrated in Figure 8 this group consists of two cogwheels, a connecting shaft and the minute pointer. In this manner this single expression will affect all of these objects.
The rotateZ attribute is the one being affected by the expression and simply tells the program that we want to rotate the group in the z-direction. The time attribute simply returns the current time of the animation in seconds. This value is multiplied by 6.6 in order to speed up the rotation speed.
This is of course a very simple expression, but it gets the job done. The same expression principle is used for the resulting cogwheels and pointers, only with different multiplier values. Furthermore, the entire clock with all of its objects and its pedestal are grouped and animated with a rotateY expression, which not surprisingly makes it rotate in the horizontal axis.
While the geometry defines the shape of an object, its material defines how the object will display once rendered. Though this is one of the more difficult areas of Maya, a basic understanding of how objects are shaded is a needed. In order to achieve realistic looking images, the qualities of materials such as the color, specularity, reflectivity and transparency must all be adjusted. These qualities of the materials can be set up using special shading networks, which are managed in the hypershade editor.
Maya includes several different types of materials such as Phong, Blinn and Lambert, which each holds different shading characteristics. The main difference between these is the way they handle specular highlights when rendered (Alias, 2013, p. 60).
Since both the cogwheels and casing of a clock are made of metal I have used the mia_material_x for these surfaces. This is a development of the Blinn material, which Jim Blinn developed in the seventies (Blinn, 1977). The mia_material uses the mentalray render and was designed specifically for architectural design renderings and supports hard surface materials, such as metal, with its glossy reflections and refractions (Autodesk, 2013). Since optimizing these materials for the proper metallic look is a rather difficult task, I have used a set of professionally developed shaders (LeFebvre, 2010). The mia_materials shaders for the clock casing and pointers are my adjustments of the preset shaders of Maya’s mentalray. Figure 9 shows the materials in the hypershade editor.
Darkness is the absence of light. Without the lighting all we would be left with are black blobs of nothing, which would make for a very boring animation. The lights define the shape and form of objects and spaces. Furthermore it can be used to set the mood and create an atmosphere. Obviously this is an important part of the 3D production. However, lighting setup is definitely not my cup of tea. To be quite frank, it is a total nightmare.
Maya offers different light sources, which will illuminate the scene differently. The most typical types are directional, spot and point lights. The most common lighting technique is the three-point lighting, which is used in both photography and Hollywood studio films. This method uses a key, fill and back light as the main sources of light in the scene. The classical Hollywood style is characterized by high key lighting, which in the early days ensured that all the money spent on the set and props would be clearly visible (Digital Film Archive, 2013). This classic Hollywood style seemed like the ideal choice for the clock presentation.
But this setup is not easy to achieve. I tried tweaking different lights and attributes but the result always looked like crap – and not photo realistic at all.
Image based lighting (IBL)
Instead of the spending all my time with the hopeless setup of three-point lighting, I used an HDR sphere instead. The concept of the image-based lighting is based on lighting the scene with natural color values from an image. This method relies on the mental ray render to create the realistic looking lights.
The basic process involves adding a surface shader with an HDR image node onto a dome (sphere). The HDR image is a special image, which unfortunately requires lot of setup to create. So, instead of using a real HDR image I am using a procedural texture, which is a computer-generated representation of the natural environment. The IBL setup is illustrated in Figure 10 where the HDR sphere is illustrated in the wireframe mode and the objects are seen placed in the center of part the spherical dome. Since the dome emits light from all sides the clockwork is shielded with a backdrop plane.
I think the results produced with this technique looks quite nice and are definitely easier to create than the three-point lighting technique. Of course there may still be areas, which could be improved with additional lighting inside the scene. An example is the space inside the clock casing, which looks a bit underexposed in the final renderings. But generally I am satisfied with this lighting setup.
This the part where all efforts, all the hard work and all the general faith in life is smashed into bits of atoms by unreliable hardware and coincidental circumstance. Well, perhaps not quite so. In fact this is the joyous part where you kick back with a cup of coffee and pray the render does not crash – but of course it eventually does.
Rendering with mental ray
I used the Mental Ray engine since its more powerful and produce better results than the Maya engine. In order to achieve a high quality of reflections and shadows I used raytracing. This technique produces better results than other engines such as scanline rendering methods – but this of course adds time to the rendering process. Since Maya apparently always crashes during render time, I used the batch render functionality, which produces sequence image files for each frame. This way the rendered images were safe and secure when the render finally crashed, which in my case happened after 80 hours of rendering. Unfortunately, I did not realize that command line rendering is an actual possibility until after I had finished rendering. In the future I will probably use command line rendering instead since this is a much more stable approach (Keller, 2010, p. 669).
In order to make the deadline of the project I chose to save time by outputting the images as .jpeg files instead of .tiff files. The .tiffs offer far better quality than .jpeg which are compressed, but I think this was a good decision since the renderer would probably still be at it, if I had chosen .tiff.
Another problem I encountered during the rendering phase, are weird rendering errors on three non- adjacent frames. Figure 11 shows how this error occurs on frame 1318. The error is a small imperfection on the shadow of the pedestal. While this is tiny imperfection, it is nevertheless quite visible when the animation is played back.
In order to solve this problem I tried re-rendering the three frames separately – this however did not solve the problem. An explanation for these errors is possibly the anti-aliasing setting, which is used to control and reduce flickering and artifacts along the edges of the objects (Keller, 2010, p. 676).
Nevertheless, it was only three frames with this error; therefore I simply imported the images into Photoshop and fixed the imperfections so they are no longer noticeable in the final animation.
Everything must come to and end. Hopefully this does not apply to my ongoing development with 3D animation and Maya. The process of creating this clock animation has been both fun and also quite enlightening. As witnessed by my preceding writings, I actually did not face any real major problems during this project, besides the mentioned rendering issues. Sure, it has been a challenging process of trial and error in some of the phases, but the problems have really been minimal. Perhaps this is due to some of the experience I already had with the program – limited as they were. Quite befitting, I remember a funny anecdote, which was passed to me by Mr. Jens Blemmer, the headmaster of the watchmaker school I mentioned in the introduction. Apparently, his old teacher and mentor always gave him a lot grief for not making any mistakes and oftentimes told him “make some damn mistakes Jens – that’s the only way you will ever learn!”
If I were to believe the old mentor of Mr. Blemmer, I guess that would mean I have yet to uncover my full potential of 3D animation with Maya. No matter what, I am personally more than satisfied with my learning outcome of the course. At the onset of this project, I did not expect the result to turn out as well as I believe it has. Therefore I feel quite confident and exited about exploring even more of Maya in the future.
Alias (2013). The Art of Maya: An Introduction to 3D Computer Graphics. 4th ed. Sybex.
Autodesk. (2013). Softimage User’s Guide. [online] Retrieved 15 May 2013 from: http://download.autodesk.com/global/docs/softimage2013/ en_us/userguide/index.html?url=files/mentalray_mia_mat erial.htm,topicNumber=d30e720074
Blender Cookie (2010). Learning Mesh Topology Collection. [online] Retrieved 15 May, 2013 from: http://cgcookie.com/blender/cgc-series/learning-mesh-topology-collection/#header
Blinn, J. (1977). Models of light reflection for computer synthesized pictures. Proc. 4th annual conference on computer graphics and interactive techniques.
Cazzie (2012). Animation history | Trial Image Ink. [online] Retrieved 15 May, 2013 from: http://trialimagestore.com/blog/tag/animation-history/
Digital Film Archive (n.d). Three Point Lighting. [online]. Retrieved 14 May 2013 from: http://www.digitalfilmarchive.net/clda/docs/ThreePointLi ghting.pdf
Furniss, M. (2007). Art in Motion: Animation Aesthetics. Bloomington: Indiana University Press.
Keller, E. (2010). Mastering Autodesk Maya 2011. Indianapolis, Ind.: Wiley Technology Pub.
LeFebvre, D. (2010). Metal shaders. Retrieved 14 May 2013 from: http://www.creativecrash.com/maya/downloads/shaders/ c/dl_metalshaders–2
Nerdplusart (2011). nerdplusart.com. [online] Retrieved 15 May, 2013 from: http://nerdplusart.com/first- 3d-rendered-film-from-1972-and-my-visit-to-pixar
Scientific American. (2012). A Brief History of Clocks Retrieved May 15, 2013, from http://www.scientificamerican.com/article.cfm?id=a- chronicle-of-timekeeping