<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE page SYSTEM "gen/gandraxa.dtd">
<?xml-stylesheet type="text/xsl" href="gen/gandraxa.xsl"?>
<!--
	To see this page properly, install a browser capable of
	interpreting XML/XSL, for example a recent version of:
	- Mozilla Firefox, see http://www.mozilla.com/
	- Google Chrome, see www.google.com/
	- Internet Explorer, see http://www.microsoft.com/
-->
<page>
	<head>
		<title>Walking Isometric Avatars (III)</title>
		<url>http://www.gandraxa.com/walking_isometric_avatars_part_3.xml</url>
		<context>
			<path>
				<home>
					<link loc="int">
						<url>home.xml</url>
						<text>Home</text>
					</link>
				</home>
				<dir>
					<link loc="int">
						<url>articles.xml</url>
						<text>Articles</text>
					</link>
				</dir>
				<dir>
					<link loc="int">
						<url>designing_isometric_avatars.xml</url>
						<text>Designing Isometric Avatars</text>
					</link>
				</dir>
				<doc>Walking Isometric Avatars (III)</doc>
			</path>

			<chain>
				<prev>
					<link loc="left">
						<url>walking_isometric_avatars_part_2.xml</url>
						<text>Walking Isometric Avatars (II)</text>
					</link>
				</prev>
				<next>
					<link loc="right">
						<url>walking_isometric_avatars_part_4.xml</url>
						<text>Walking Isometric Avatars (IV)</text>
					</link>
				</next>
			</chain>
		</context>
		
		<author>
			<mail>
				<recipient>hg</recipient>
				<server>gandraxa.com</server>
				<name>Herbert Glarner</name>
			</mail>
		</author>
		
		<publ>
			<event>
				<eventdate><y>2007</y><m>Apr</m><d>23</d></eventdate>
				<eventtext>First published</eventtext>
			</event>
			<event>
				<eventdate><y>2011</y><m>Feb</m><d>07</d></eventdate>
				<eventtext>
					Recoded in XLM
				</eventtext>
			</event>
		</publ>
		
		
<!-- both pages not available anymore
		
<furtherreading>
		
	<readitem>
		
		<link loc="ext">
		
			<url>http://graphics.ucsd.edu/courses/cse169_w07/CSE169_13.pdf</url>
		
			<text>Locomotion</text>
		
		</link> [PDF], by the UCSD
		
	</readitem>
		
	<readitem>
		
		<link loc="ext">
		
			<url>http://connection.lww.com/products/hamill/documents/smch1.pdf</url>
		
			<text>Foundations of Human Movement</text> [PDF]
		
		</link>
		
	</readitem>
		
</furtherreading>
		-->
	</head>

	<toc>
		<toc1 ref="A">Arms</toc1>
			<toc2 ref="A1">Properties</toc2>
			<toc2 ref="A2">Analyzing the Motion</toc2>
			<toc2 ref="A3">Planning the Frames</toc2>
			<toc2 ref="A4">Designing the Frames</toc2>
	</toc>

	<abstract>
	<p><ptitle>Abstract</ptitle>
		The third part of this subseries finalizes the outlines of a walking avatar 
		by analyzing the motion of arms and subsequently designing the needed frames, 
		eventually presenting the completed avatar in animated GIFs.</p>
	</abstract>



	<part>
		<heading id="A">Arms</heading>
		<chapter>
			<heading id="A1">Properties</heading>
			<body>
				<p>In our context, the motion of the arms is more complex than that of the legs. 
					This is because we have to keep them in sync with the legs.</p>
				<p>We distinguish 3 parts: the humerus (upper arm), the forearm and the hand, 
					all of these included in a single component 
					(although the hand won't play a big role in our designs 
					due to the avatar's small size). 
					The shoulders, where our arms will be attached to the torso, 
					are already part of the avatar's torso, so we can omit that part 
					and concentrate on the rest. However, we should pay some attention to have 
					a well-rounded connection at the shoulder.</p>
				<p>The single most important feature of the arm is its length in proportion 
					to the whole avatar. A simple non-scientific observation tells, 
					that an arm loosely hanging from the shoulder will lead to the tips 
					of the hand roughly at the middle of the hip. 
					Another observation makes it apparent, that the humerus and the forearm 
					approximately are of the same length. Also, the total arm length 
					is approximately 70% of the leg length.</p>

			</body>
		</chapter>
		<chapter>
			<heading id="A2">Analyzing the Motion</heading>
			<body>
				<p>Humerus and forearm swing while walking, and the hand is more or less 
					just an extension of the forearm. Each part is attached at a joint 
					(shoulder, elbow, wrist). Whereas shoulder and wrist allow some freedom 
					in rotating the components negatively or positively, the elbow 
					is restricted in its movement into a positive (forward) rotation only 
					(at least when we only consider the swinging movement in walking direction, 
					such neglecting sideward motion, which in reality does occur as well).</p>
				<infobox float="right" width="215">
					<boxtitle>Biomechanics</boxtitle>
					<body>
						<p>For biomechanical details, see the article 
							<link loc="ext">
								<url>http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=1571305</url>
								<text>"Biomimetic robotics"</text>
							</link> in the Journal of Anatomy, and there especially
							fig. 2 to 4.</p>
					</body>
				</infobox>
				<p>Humerus and thigh (i.e. the upper part of the leg) on opposite sides 
					interact with each other: while the thigh swings forward, the humerus 
					on the opposite side swings backward (although at a smaller angle), 
					and vice-versa.</p>
				<img float="left" width="180">
					<url>img/wia_fig14.jpg</url>
					<alt>Swinging arm.</alt>
					<caption>Fig. 14: Swinging arm.
						Left: a is ±15° and b 60° at its maximum. 
						Right: Interpolation for 8 frames.</caption>
				</img>
				<p>During the humerus' backward swing, the forearm appears to be 
					a straight extension of it, but during a forward string, the forearm 
					begins to make an angle at the elbow with a maximum when the toes 
					of the foremost foot touch the ground.</p>
				<p>The humerus swings with an angle of approx. ±15° from the vertical,
					while during forward swings the forearm makes an angle between 
					the elbow and the vertical of approx. 60° at its maximum (fig. 14 left). 
					The angle grows linearly in between, so that it is trivial to interpolate 
					from frame to frame (fig. 14 right).</p>
				<p>In the figure, the angle is incremented by 15° between each frame, 
					representing a position each. Since a whole gait cycle consists of 16 frames,
					it could seem that we'd actually needed 16 different images with 7.5° 
					steps in between, but that would be wrong: an arm's position 16 frames 
					later must have completed a whole cycle, which consists of a forward 
					<em>and a backward</em> swing, each direction requiring 8 frames. 
					This means, that different to the design of legs we can re-use 
					a once drawn arm position again and insert it into the appropriate frame 
					for the other direction. (This was not possible for the legs, 
					because there we had a stance and a support phase, 
					i.e. the two half phases differed.)</p>
			</body>
		</chapter>
		<chapter>
			<heading id="A3">Planning the Frames</heading>
			<body>
				<img float="left" width="233">
					<url>img/wia_fig15.jpg</url>
					<alt>Trivial graphic manipulation to obtain joints and end points</alt>
					<caption>Fig. 15:  Trivial graphic manipulation to obtain joints 
						and end points</caption>
				</img>
				<p>For the actual design, it is easiest to draw a schematic draft 
					as before in fig. 14, only that this time we use the appropriate arm length. 
					To determine the length, we don't count the upper part of the shoulder 
					(which is included in the design of the trunk anyway), but start out 
					at an assumed hinge 2 pixels below our draft. From there 
					to the tip of the hand we have 26 pixels (see 
					<link loc="int">
						<url>components_of_isometric_avatars.xml#C1</url>
						<text>Components of Isometric Avatars</text>
					</link>, section "Decomposing the Parts").</p>
				<p>Calculating the 8 elbow joints and end positions as per fig. 14 leaves us 
					with fig. 15 (a). We immediately remove the disturbing black lines 
					and only keep the shoulder hinge and the 2 &#215; 8 points 
					on the two curves (b).</p>
				<p>Then we use the same technique as applied previously in 
					<link loc="int">
						<url>walking_isometric_avatars_part_2.xml#A2</url>
						<text>Part II</text>
					</link>, subsection "Moving the Feet", to bring our figure 
					into the required isometric aspect, i.e., scaling down horizontally to 89% (c) 
					and stretching 27° (d). Note, that all these operations can easily be done 
					even with the most basic graphic manipulation tools, 
					such as Microsoft Paint.</p>
				<p>A horizontal mirror of (c) starts a second image manipulation chain (i) to (n) 
					for the two upward orientations, i.e. NW and NE.</p>
				<p>As our avatar has two arms and moves them equally (although 180° out of phase), 
					we can save ourselves a lot of time by including the 17 relevant pixels 
					for the other arm as well. Since the angles do not change when doing so, 
					we can use a copy and translate it some pixels. 
					How many exactly is reveiled, when looking at the avatar and measuring 
					the distance between the inner boundary of the shoulders.
					We can see, that they are 10 horizontal and 5 vertical pixels apart 
					(it is important to maintain the 2:1 ratio: otherwise the positions 
					of the arms will look wrong in the end). 
					It is a good idea to color the points for the two arms differently. 
					The result (e) consists of 34 position points.</p>
				<p>Now it's time to copy all these position points onto our avatar (f). 
					When doing so, it is again a good idea to grey out the avatar: 
					such we can quickly remove its contour lines later on. 
					The overlay returns some feedback by providing a vague idea 
					on how the arms will move. However, this is not the only reason 
					for this step: later on we will need to apply individual pixel pairs 
					onto the frames of the <em>moving</em> avatar. 
					To be able to quickly locate these positions without the tedious 
					and error-prone task of counting (recall that also the body itself 
					moves vertically), we will need a reference point. 
					A such we have: the head itself remains the same in all frames 
					which we designed above. Therefore we remove all the points which 
					do not belong to the head, of course keeping our joint and end points (g).</p>
				<p>Horizontally mirroring (g) returns one of the other orientations (h). 
					However, it's shown here for completeness only: it is easier 
					to just mirror the final 16 frames in the end.</p>
				<multiimg orientation="horizontal" float="left" width="230">
					<img>
						<url>img/wia_fig16_a1.gif</url>
						<alt>Position of swinging arms, SE orientation</alt>
						<caption>Fig. 16a: Position of swinging arms, SE orientation</caption>
					</img>
					<img>
						<url>img/wia_fig16_a2.gif</url>
						<alt>Position of swinging arms, NW orientation</alt>
						<caption>Fig. 16a: Position of swinging arms, NW orientation</caption>
					</img>
				</multiimg>
				<p>Let's do a rudimentary check and create two animated GIFs. 
					For this we connect the 3 end points of each frame with 2 lines each 
					and play them in sequence, at the by now familiar 16.67 Hz (fig. 16).</p>
				<p>Well, this was it for the fun part: we are ready for some real work now.</p>
				<p>By the way, I don't want to disappoint any artist out there, 
					but the presented technique once again does not leave much room 
					for creativity.</p>
			</body>
		</chapter>
		<chapter>
			<heading id="A4">Designing the Frames</heading>
			<body>
				<p>The following table shows the frames for Pixie's arms. As a basis, 
					it is best to use the previous frames set including the legs for your design, 
					in order to obtain some feedback "if it looks right". 
					Because the legs and arms overlap in some frames, I greyed out 
					the now unrelated legs, i.e. all the avatars' contour lines: 
					this facilitates later extraction of the arms once they are designed 
					(after all, in the end we only need the individual components, 
					not the whole picture).</p>
				<p>The first step is to copy the relevant shoulder/elbow/fingertips-triplets 
					(note the plural: we have 2 arms &#215; 3 points = 6 colored pixels) 
					over each frame. This is the basis for the second step: the actual design. 
					Note, that many position pixels of the rear arm will be hidden by the body: 
					such parts of course require a reduced design only, or none at all.</p>
				<p>Before actually designing the arms, recall that we <em>defined</em> 
					the colored pixels to represent joints and end points 
					at the <em>inner side</em> of the arm, i.e. close to the avatar's body: 
					thickness must be added towards the outer side, i.e. away from the body. 
					As two points can be connected only by a single line, 
					there is a certain freedom when "adding flesh to the bones". 
					However, it is important to stay as consistent as possible with 
					the thickness of the arms.</p>
				<p><ptitle>Important</ptitle>
					Remember to save the two arms as <em>two separate components</em>, 
					one for each arm. They are in two different layers and must 
					be rendered at very different points in the rendering sequence. 
					If you save both arms as one component, there will be many flaws 
					and wrong renderings when garment is added.</p>
				<p>Note, that the positions where the avatar can be halted 
					(i.e. frames 2 and 10 in following table) are a neutral point, 
					i.e. the arms are hanging apparently loose as in frame 0, 
					even though they represent the middle of the swinging motion. 
					This makes frames 6 and 14 those two positions, 
					at which the arms reach out the most (right arm backwards in frame 6, 
					forward in frame 14, and vice-versa).</p>
				<table>
					<row>
						<multirow rows="6">Orientation SE</multirow>
						<col>Frame</col>
						<col>0</col>
						<col>1</col>
						<col>2</col>
						<col>3</col>
						<col>4</col>
						<col>5</col>
						<col>6</col>
						<col>7</col>
						<col>8</col>
					</row>
					<row>
						<col>Positions</col>
						<col>
							<img><url>img/wia_fig16_00.jpg</url><alt>Frame 0</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_01.jpg</url><alt>Frame 1</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_02.jpg</url><alt>Frame 2</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_03.jpg</url><alt>Frame 3</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_04.jpg</url><alt>Frame 4</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_05.jpg</url><alt>Frame 5</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_06.jpg</url><alt>Frame 6</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_07.jpg</url><alt>Frame 7</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_08.jpg</url><alt>Frame 8</alt></img>
						</col>
					</row>
					<row>
						<col>Artwork</col>
						<col>
							<img><url>img/wia_fig17_00.jpg</url><alt>Frame 0</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_01.jpg</url><alt>Frame 1</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_02.jpg</url><alt>Frame 2</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_03.jpg</url><alt>Frame 3</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_04.jpg</url><alt>Frame 4</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_05.jpg</url><alt>Frame 5</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_06.jpg</url><alt>Frame 6</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_07.jpg</url><alt>Frame 7</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_08.jpg</url><alt>Frame 8</alt></img>
						</col>
					</row>
					<row>
						<col>Frame</col>
						<multirow rows="3"></multirow>
						<col>9</col>
						<col>10</col>
						<col>11</col>
						<col>12</col>
						<col>13</col>
						<col>14</col>
						<col>15</col>
						<col>16</col>
					</row>
					<row>
						<col>Positions</col>
						<col>
							<img><url>img/wia_fig16_09.jpg</url><alt>Frame 9</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_10.jpg</url><alt>Frame 10</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_11.jpg</url><alt>Frame 11</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_12.jpg</url><alt>Frame 12</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_13.jpg</url><alt>Frame 13</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_14.jpg</url><alt>Frame 14</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_15.jpg</url><alt>Frame 15</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_16.jpg</url><alt>Frame 16</alt></img>
						</col>
					</row>
					<row>
						<col>Artwork</col>
						<col>
							<img><url>img/wia_fig17_09.jpg</url><alt>Frame 9</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_10.jpg</url><alt>Frame 10</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_11.jpg</url><alt>Frame 11</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_12.jpg</url><alt>Frame 12</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_13.jpg</url><alt>Frame 13</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_14.jpg</url><alt>Frame 14</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_15.jpg</url><alt>Frame 15</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_16.jpg</url><alt>Frame 16</alt></img>
						</col>
					</row>
				
				
					<row>
						<multirow rows="6">Orientation NW</multirow>
						<col>Frame</col>
						<col>0</col>
						<col>1</col>
						<col>2</col>
						<col>3</col>
						<col>4</col>
						<col>5</col>
						<col>6</col>
						<col>7</col>
						<col>8</col>
					</row>
					<row>
						<col>Positions</col>
						<col>
							<img><url>img/wia_fig16_00b.jpg</url><alt>Frame 0</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_01b.jpg</url><alt>Frame 1</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_02b.jpg</url><alt>Frame 2</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_03b.jpg</url><alt>Frame 3</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_04b.jpg</url><alt>Frame 4</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_05b.jpg</url><alt>Frame 5</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_06b.jpg</url><alt>Frame 6</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_07b.jpg</url><alt>Frame 7</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_08b.jpg</url><alt>Frame 8</alt></img>
						</col>
					</row>
					<row>
						<col>Artwork</col>
						<col>
							<img><url>img/wia_fig17_00b.jpg</url><alt>Frame 0</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_01b.jpg</url><alt>Frame 1</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_02b.jpg</url><alt>Frame 2</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_03b.jpg</url><alt>Frame 3</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_04b.jpg</url><alt>Frame 4</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_05b.jpg</url><alt>Frame 5</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_06b.jpg</url><alt>Frame 6</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_07b.jpg</url><alt>Frame 7</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_08b.jpg</url><alt>Frame 8</alt></img>
						</col>
					</row>
					<row>
						<col>Frame</col>
						<multirow rows="3"></multirow>
						<col>9</col>
						<col>10</col>
						<col>11</col>
						<col>12</col>
						<col>13</col>
						<col>14</col>
						<col>15</col>
						<col>16</col>
					</row>
					<row>
						<col>Positions</col>
						<col>
							<img><url>img/wia_fig16_09b.jpg</url><alt>Frame 9</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_10b.jpg</url><alt>Frame 10</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_11b.jpg</url><alt>Frame 11</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_12b.jpg</url><alt>Frame 12</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_13b.jpg</url><alt>Frame 13</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_14b.jpg</url><alt>Frame 14</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_15b.jpg</url><alt>Frame 15</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig16_16b.jpg</url><alt>Frame 16</alt></img>
						</col>
					</row>
					<row>
						<col>Artwork</col>
						<col>
							<img><url>img/wia_fig17_09b.jpg</url><alt>Frame 9</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_10b.jpg</url><alt>Frame 10</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_11b.jpg</url><alt>Frame 11</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_12b.jpg</url><alt>Frame 12</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_13b.jpg</url><alt>Frame 13</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_14b.jpg</url><alt>Frame 14</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_15b.jpg</url><alt>Frame 15</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_16b.jpg</url><alt>Frame 16</alt></img>
						</col>
					</row>
				</table>
				<p>This is how the frames look like when animated:</p>
				<table>
					<row>
						<col>Motion</col>
						<col>Details</col>
						<col>SE</col>
						<col>NW</col>
					</row>
					<row>
						<col>Continuous Walking</col>
						<col>
							Frames 3-16 and 1-2<br/>
							All with 60 ms/frame<br/>
							(16.67 Hz)
						</col>
						<col>
							<img><url>img/wia_fig17_a1.gif</url><alt>Continuous Walking SE</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_a2.gif</url><alt>Continuous Walking NW</alt></img>
						</col>
					</row>
				</table>
				<p>The mirrors for the NE and SW orientations follow the same technique 
					applied when we designed the legs. Don't forget to consider the phase shift, 
					so that the avatar actually starts to walk with the right leg.</p>
				<table>
					<row>
						<col>Motion</col>
						<col>Details</col>
						<col>SW</col>
						<col>NE</col>
					</row>
				
					<row>
						<col>Continuous Walking</col>
						<col>
							Frames 11-16 and 1-10<br/>
							All with 60 ms/frame<br/>
							(16.67 Hz)
						</col>
						<col>
							<img><url>img/wia_fig17_a3.gif</url><alt>Continuous Walking SW</alt></img>
						</col>
						<col>
							<img><url>img/wia_fig17_a4.gif</url><alt>Continuous Walking NE</alt></img>
						</col>
					</row>
				</table>
			</body>
		</chapter>
	</part>
</page>

