TITLE: The Great Pen Mystery

NAME: Ian Print
COUNTRY: England

EMAIL: ian.print@ntlworld.com
WEBPAGE: http://www.escape-from-reality.co.uk (this is actually my wife's webpage, but I get mentioned here and there - I haven't done my own yet)


TOPIC: Slow Motion
COPYRIGHT: I SUBMIT TO THE STANDARD RAYTRACING COMPETITION COPYRIGHT.
MPGFILE: ip_pen.mpg
ZIPFILE: ip_pen.zip
RENDERER USED: 
    Blender 1.8


TOOLS USED: 
    Video camera and scanner (to get textures), Paintshop Pro 4.15 SE
(for editing textures), Word (for creating one texture), Studio DC10+ 1.05 (for
putting sound track together), GoldWave 4.12 (for recording and editing
sounds), TMPGEnc 12a  (to encode the MPEG) 


CREATION TIME: 
    5 hours 53 mins (rendering took 5 hour 34 mins, other processing
19 mins) for the final render. It took me just over 2 months to complete,
averaging probably a few hours each day, maybe (hard to tell), in my spare
time.


HARDWARE USED: 
    466 MHz Celeron


ANIMATION DESCRIPTION: 

Have you ever wondered why it is that when you drop a pen (or any other
relatively small object for that matter) that it always ends up halfway across
the room from where you dropped it, tucked around some corner, where it could
not have possibly got to by obeying the normal laws of physics? Well this
animation shows what I think actually happens.

DEDICATION:
This is dedicated to my wife, Rhoda - who has had to put up with me spending
ages on this over the past two months, and neglecting her far too much.


VIEWING RECOMMENDATIONS: 
    I use the normal windows media player, although the
display from the onboard graphics chip always seems darker than the equivalent
still shot in blender/PSP etc - so I have adjusted the gamma for the overlay
window. It looks ok without any adjustment on other PC's that I've tried.


DESCRIPTION OF HOW THIS ANIMATION WAS CREATED: 

This is my first attempt at a "proper" animation. I've just done a few little
bits and pieces before, mainly playing around with the Blender software, and
trying various tutorials. There was a lot I had to learn about during the
creation of this animation - especially modelling, skeleton animation,
texturing, lighting.

All the modelling and animation, and titling was done in Blender - an excellent
free 3D program, available from http://www.blender.nl/

I created all the objects myself, except for the hands which I downloaded from
the internet somewhere (can't remember where). I'm not too good at modelling
organic things like hands - it would have taken me far too long.
The desk and the creature (named Misfit) took the most time to model.

I created all the textures myself, except for four of them - the wood on the
desk, the wood on the bookcase where Misfit hides the pen, the cover for the
Blender manual and the marble for Misfit's wheels (these were downloaded from
the internet). I used a scanner for things like the pieces of paper and
leaflets, and a video camera to grab stills for objects like the cardboard
boxes, CDs, and carpet. I used Paintshop Pro to convert some of the stills to
repeatable tiles for things like the carpet and wallpaper, and for changing the
colour and gamma on some of those that didn't come out too well from the video
camera. I made the bump map for Misfit's eyes using Word, as I couldn't figure
out a way of using any paint program that I had to do this. I used the
autoshapes, hexagon, with radial fill, and built up an area full of these, did
a screen grab, and put it into PSP. I was quite please with the result.

I was aiming at trying to get a realistic look to the animation - hence the
scattering of everyday objects all over the place. I also added various other
procedural textures to the desk to try to stop it looking like it was brand
new, as it did with just the wood texture on it's own.

Anyone who is interested in the gory technical details can now carry on reading.
Those who suffer from information overload, please stop reading now.

I did a quick mock up of what I wanted to do in the animation first - using
simple shapes like tubes, cubes and spheres. Just to check out that I could
actually do what I wanted to do, without getting bogged down in all the
details.

For creating the final version I tried to link as many objects as possible into
the different scenes, so that if I wanted to edit them the changes would be
appear in all the scenes. Sometimes this was not possible, and I had to make
duplicates - for example the arms - I found that they were at the wrong angle
for the upward view in scene 2, after I had finished the first person view in
scene 1. Both duplicated still used the same mesh, however, so when I changed
the shirt, a few times, it only had to be done in one place.
It ended up a lot messier than I originally wanted it to be, but tidier than it
would have been without any planning.

To get the writing to appear on the paper I did the following:
There are two sheets of paper. One at the bottom with all the completed writing
on it, and one just above it (very closely spaced) with that part of the paper
still blank. I then added a curved path which traced the new writing (loading
the texture from the bottom sheet into the background buffer on the screen to
see where it went). I then added an object with a white halo texture with the
path as a parent, so that it followed the curve. I then fiddled with the Time
IPO so that the halo moved slowly along each text line and jumped quickly back
to the start of the next line (as you do when you write). I then rendered this
animation to an AVI file giving a black background with a white trail building
up over the text area. I then used this AVI as an alpha map on the top sheet of
paper - thus making it transparent in the white area, allowing the text to show
through from the sheet underneath. This struck me as a lot of effort to get
this effect, but I couldn't think of any other way of doing it. In the final
animation I'm not sure you can actually see that the text is appearing as the
pencil goes across the page (unless you look very closely) so I could probably
have got away with something simpler. But it was satisfying to get it to work.

The scribbling of the pencil was done as follows:
I bent the fingers into the right shape using an IKA skeleton. I did want to use
multi-limbed inverse kinematics for the fingers, but I couldn't get the
original fingers to bend the right way (as they started off flat) so I used
several single limbed forward kinematic ones. (Maybe I should have tried
bending with a lattice and applying the bend permanently as a starting point,
but I didn't think of that at the time). I swapped the last joint of the thumb,
index and middle finger IKAs to inverse kinematic mode, and made empties the
parents for each (controlling the effector). Then I made another empty called
twitcher, which is the parent of all three empties. Moving this around a small
amount gives a twitching motion to the 2 fingers and thumb holding the pencil.
I then put the pencil into place (quite tricky to do) and made the centre of
the pencil at the point where it rests against the hand. Then I added another
empty called pencil-tracker near the end of the pencil and made the pencil
track this empty. Then I made the twitcher the parent of the pencil-tracker. So
then moving the twitcher also moves the pencil point so it swivels about the
centre point. There are more empties: r-hand-e which is the parent of all the
IKAs in the hand, and the effector of the arm, r-hand-and-pencil which is the
parent of the r-hand-e and the pencil and the twitcher, r-arm-and-hand which is
the parent of r-hand-and-pencil and the arm IKAs. This allows movement of the
whole arm+hand+pencil, or hand+pencil, or hand. I then copied the original
curve that made the animated texture and put it onto the sheet of paper, with a
child object to follow the path. I then tried to get the end of the pencil to
follow it by animating the r-hand-and-pencil empty. I couldn't use the curve to
animate the hand because the parts where it moved back from the right of a line
to the start of the next didn't go in the place a hand would when writing (they
looped around too much - to avoid going over another line of text). So I had to
animate the hand by hand, as it were!
When doing test runs I found that I couldn't get the pencil point to be in quite
the same place as the writing was appearing - there was always a noticeable
difference. So I decided to rotate the hand a little, so it covered up the
place where the text was appearing. Unfortunately this totally messed up the
tracking of the pencil, which flipped about all over the place. I had to take
of the tracking, move the pencil about, put it back on and try to line it up
again. I think the pencil now sticks through the hand a little bit, but
hopefully not to a noticeable extent.

The arms use a TextMesh mapping to get the material to follow the bend at the
elbow. I only recently discovered this feature. There is an unbent cylinder,
used for the mapping, and then duplicates of this, which were bent into shape,
and tweaked to give a few bumps. I wanted to try to get a few wrinkles in the
mesh but I couldn't figure out how to do it. The texture is actually from a
video of one of my shirts.

The desk took quite a while to model. I used bevelled curves to create the
twiddley bits around the top, and for the front of the drawers. The drawers are
separate objects, and can open, just like the real thing! The legs were also
originally bevelled curves, but when converted to meshes, duplicated 8 times,
and stuck onto the bottom of the desk it pushed up the polygon count so high
that it slowed down the view of the object to an unworkable amount. I had redo
them by spinning poly-lines. The desk still has way too many polygons than are
good for it.

The first attempt at the wallpaper wasn't too good. I used the video camera, but
it came out looking rather grey and grotty. So I nipped out to B&Q and got a
sample of the same sort of paper and stuck it in the scanner. That turned out a
lot nicer. The bump map was made from doing the "histogram/equalize" function
in PSP, which created a nice high contrast black and white image from the
original (more by accident than design!)

The blur that shoots out and grabs the pen in the normal speed scene is a
stretched-out semi-transparent ico-sphere (not the real Misfit). I want it just
to look like a fast blur - too fast to see properly. If I had used the real
misfit there, he might have been too noticeable. I also used the motion-blur
option in Blender for this scene, partly to add more blur to the ico-sphere and
also to smooth the motion of the dropping pen.

To get the slow motion replay of the pen dropping I duplicated the pen and the
arm, and stretched the IPOs by a factor of 10. I could have used the option to
change the animation speed in Blender but this would have moved the frame
numbers up and overlapped them with other scenes, which could have been very
confusing.

The "Slo Mo Cam" text has the camera as a parent, so it moves with it. Then a
material IPO was added to change the transparency from 0.3 to 0.0 and back with
a 1 second interval.

The large text between the normal speed and the slow motion scenes was also done
in Blender. Layer IPOs were used to switch between the different words. (And
the lights were dimmed just before displaying the text).

I decided to use wheels on Misfit as I knew that animating some legs would
probably take me over the time limit, at least to get anything vaguely
realistic. As it was, it took about 2 months to get to the nearly finished
stage, using wheels. The animatable bits of Misfit are the head, which rotates
or goes up and down, the antennae which can waggle (using linked IKAs in
Inverse mode), and the tail which can be bent in various ways. I did try to use
IKA chains in Inverse mode for the tail, but found it possible to bend only in
one direction like that. So instead I used a parented chain of Forward mode
IKAs, which means that each one has to be rotated separately to get the tail to
bend - so in practice I only bothered to bend three of the segments.

For the scene where the camera follows Misfit under the desk I used an empty
placed just in front of Misfit, with Misfit as the parent object. Then I made
the camera track the empty. This make the camera point just in front of where
he's going. I also animated the position of the empty a little as well so that
it didn't look too rigid.

The other camera animations, where it actually moves, were done by hand, without
any tracking - just by moving/rotating the camera and adding keyframes - then
tweaking the final animation curves in the IPO editor to get rid of any wild
movement.

I had a bit of trouble with the lighting, as this was my first attempt using
shadows and trying to get a realistic lighting scheme. (All the other things I
did before just had one or two hemi lights). I'm not too happy with the result,
but I'll need to do some more practice with lighting before I get any good at
it. I used a yellow lamp above the desk, for the main light. Then I added a
shadow casting lamp in the same place to get the main shadows around the room.
I then added 4 hemi lights radiating from the direction of the walls, with a
pink tinge to them to represent the ambient light from the walls. Then I added
a slightly yellow hemi shining from above to represent the ceiling, and a green
one shining up from the carpet. The shadows from the desk and large objects
were ok, but for the pen and Misfit they were very fuzzy and hardly visible. So
I added an extra shadow lamp above Misfit, made him the parent, and made it
track the direction of the main lamp in the room. A bit of twiddling and
tweaking was needed to get it to look reasonable - otherwise the shadows end up
very dark where they overlap other shadows. I also added a few other shadow
lamps here and there to make other shadows show up a bit more.

The sound effects were recorded using GoldWave, then the volume increased to a
more audible level (as the sounds of scribbling, and knocking a pen off a desk,
etc, were rather faint on my tidgy little PC microphone).

I used the Studio DC10+ software that came with the video editing card to
created the sound track. This makes it easy to put the sound in the right
place. However I didn't use the video output from this as input to the mpeg
encoding, as I noticed that it looked slightly darker in parts - not quite the
same as the input. So I just used the created AVI for the soundtrack input, and
use the original output from Blender as video input to the encoding.

The background music was also generated in Studion DC10 plus, from the
MasterSound thing that came with it - which lets you generate music to fit the
length of the video segements.

I used the CQ (Constant Quality) mode of TMPGEnc set to a quality of 30 and
maximum bitrate of 1200Kbps. I found that this gave a lot better picture than
any other mode, especially in the parts where there is a lot of movement. It
was also twice as fast as the 2 pass variable bit rate mode.

I have not included the textures in the source zip file, but the two Blender
files are there for anyone to look at. One to create the animated alpha map for
the text, and the other for everything else.

The time taken to render each of the scenes was as follows:

0-poster          1 min
1-writing        56 mins
2a-pen-drops     90 mins
2b-pen-drops     12 mins
3a-get-up-look   51 mins
3b-where         11 mins
4-slo-mo-drop    36 mins
5a-follow-misfit 56 mins
5b-grin          20 mins
6-logo            1 min


