A3: Direct Manipulation & Scene Graphs (Java) -- Ragdoll

Due Fri Nov 16 at 5:00 PM


Your job will be to create a "paper doll" like the one shown, and then allow it to be manipulated with the mouse -- moved about the screen, and arms, legs and head to be repositioned (within limits). Click here for a demo of a previous version of this assignment (the menus are slightly different but the ragdoll and animations are the same).


Learning Goals


Application Window

Your application will have only one window (which should be fixed-size/non-resizable, between 1024x768 and 1600x900 resolution). It should start up and show the paper doll in its default orientation (defined by you). There should be adequate space around the paper doll to demonstrate moving and manipulating it.

Your application window should have one menu, the File menu. The menu is as follows, with the corresponding keyboard accelerators:

            Reset (Ctrl-R)
            ---- (divider)
            Quit (Ctrl-Q)

Reset should reset the doll to its original orientation.

Quit should exit the application.

Paper Doll Image

Construct your paper doll as a scene graph. Each node in the scene graph should define an affine transform so it draws itself in the correct location relative to its parent's coordinate system. This transform will be passed down to children so they always draw themselves relative to their parent's coordinate system. For example, if you want to draw the torso in a particular location, you will define a translation transform, set the Graphics2D to that transform, then draw the torso at (0,0). Since you set the Graphics2D transform to a translation matrix, the torso will not actually draw at (0,0) on the screen, but at the location defined by the translation matrix. Furthermore, the head will inherit the torso's coordinate system and simply draw relative to the torso and appear in the expected location relative to the torso.

Direct Manipulation

The paper doll should be directly manipulable: You should be able to click on any body part and move it. The body parts should be manipulable according to the following constraints:

Rotating a body part is done by clicking on that body part and moving the mouse relative to the pivot point. For the body parts that support scaling, scaling is done by clicking on that body part and moving it nearer or further away from the pivot point, and you should be able to rotate and scale at the same time. The body part should not move until the mouse is moved, and it should transition smoothly from its current scale and rotation to the new scale and rotation: it should not "pop" into some default value when it's clicked.

For part marks, you can instead present a widget-based interface for rotating and scaling, for example having buttons for rotating by five degrees. You will not get full marks if you decide on this implementation.

This is a direct-manipulation interface, so you should be interacting with body parts directly. This implies that when you drag a body part with the mouse, it should stay positioned under the mouse cursor as it moves.

Choose Your Feature

Implement one or more features totalling up to 10% from this section. NOTE: this is not a bonus section, you just get to choose which feature to implement from the following list.

Technical Requirements

The following is a list of technical constraints and guidelines:


Submit the following to your personal Git repository, in the assignments/a3 subdirectory:


This assignment is graded out of 100%. If you include more than 10% in additional features, they will only grade the first ones that are submitted. The submission will be assessed roughly as follows:

Deliverables: Appropriate makefile, readme.txt, compiles and runs.
Basic functionality: Menus implemented as described; paper doll displayed in a visually pleasing manner
Translation: The entire doll can be translated using the torso.
Rotation: Head, arms, legs, etc. can be rotated, within the limits described.
Scaling: The legs can be stretched, as described.
Robustness: The interactions should be smooth, and not involve any "popping" or graphical glitches.