Blob Person

This lab continues practise with 3D transformations and coordinate space nesting. You should have completed the earlier Transformations lab before doing this one.

Download file blobby.py3d to your preferred lab directory.

As before, start an editor and then run the Python 3D viewer application with commands something like

$ gedit blobby.py3d &
$ pfpy3d blobby.py3d

We will develop an articulated rigid body humanoid model, less formally a Blob Person. This exercise was originally created by Dr James Blinn.

The blobby.py3d file supplies a set of joint angles for our humanoid body, and sample code to draw the torso. You will create the rest of the body with spheres and cylinders.

For simplicity, assume that all the joints only bend in one direction, forwards or backwards.

Create the model step by step. Don't try to do everything in one go.

Use the online Py3D documentation or ask your tutor for help with the syntax and commands. Since this course is not about Python programming you don't have to write "good" Python code. Anything that works is fine.

1 The supplied file draws a sphere for the main torso. Apply a scale transformation to improve the shape.

(Warning: it's a good habit in C/Java to indent the code between lines that begin or end matrices. Don't do that here: the Python interpreter will object.)

2 Use a translate, rotate by the neck angle, and scale to draw the head. Check that changing the neck angle does alter the image.

3 Start building an arm. Translate to the shoulder and draw a sphere for the joint.

4 Still nested inside the shoulder joint translation, rotate, translate, and draw a cylinder for the upper arm.

5 Still nested, add another sphere as the elbow joint, and another cylinder for the lower arm.

6 Add a final sphere for the hand.

If done right, changing the shoulder angle will rotate the entire arm. If the lower arm or hand detach themselves when the shoulder is rotated, you have not properly nested the transformations for the lower arm and hand.

7 Using a similar sequence, creat a leg and foot. Again, do it step by step rather than all at once.

Optional Advanced

Change the shoulder rotation to be sideways out from the body instead of forwards or backwards.

Make the neck joint three angles instead of one, and use an euler(heading, pitch, roll) matrix for the head instead of a rotation around an axis. Try changing the three angle and note how the head moves.

If you are a Python programmer, or want to learn Python: create the other arm and leg by writing functions and calling them twice instead of duplicating the code.

Make any other improvements you feel like adding.