1# -----------------------------------------------------------------------
2# Globals
3# -----------------------------------------------------------------------
4set xlation_node :t1
5set rotation_node :t1
6set root :t1
7
8tux_root_node $root
9
10#
11# Material Properties
12#
13
14tux_material white_penguin \
15            {0.58 0.58 0.58 } {0.2 0.2 0.2} 50.0
16tux_material black_penguin {0.1 0.1 0.1} {0.5 0.5 0.5} 20.0
17tux_material beak_colour \
18            {0.64 0.54 0.06} {0.4 0.4 0.4} 5
19tux_material nostril_colour \
20            {0.48039 0.318627 0.033725} {0.0 0.0 0.0} 1
21tux_material iris_colour {0.01 0.01 0.01} {0.4 0.4 0.4} 90.0
22
23
24#
25# Define the geometry
26#
27
28# Helper function to make torso parts
29proc makeBody { parent } {
30    set torso_bl "$parent:b"
31    tux_sphere $parent b 1.0
32    tux_surfaceproperty $torso_bl black_penguin
33    tux_scale $torso_bl {0 0 0} { 0.95 1.0 0.8 }
34
35    set torso_wh1 $parent:w1
36    tux_sphere $parent w1 1.0
37    tux_surfaceproperty $torso_wh1 white_penguin
38    tux_translate $torso_wh1 { 0.0 0 0.17 }
39    tux_scale $torso_wh1 {0 0 0} {0.8 0.9 0.7}
40    tux_shadow $torso_wh1 off
41
42    #set torso_wh1 $parent:w1
43    #tux_sphere $parent w1
44    #tux_surfaceproperty $torso_wh1 white_penguin
45    #tux_translate $torso_wh1 { -0.04 0 0.14 }
46    #tux_scale $torso_wh1 {0 0 0} {0.8 0.9 0.7}
47    #tux_shadow $torso_wh1 off
48
49    #set torso_wh2 $parent:w2
50    #tux_sphere $parent w2
51    #tux_surfaceproperty $torso_wh2 white_penguin
52    #tux_translate $torso_wh2 { 0.04 0 0.14 }
53    #tux_scale $torso_wh2 {0 0 0} {0.8 0.9 0.7}
54    #tux_shadow $torso_wh2 off
55}
56
57
58tux_transform : t1
59set root :t1
60set xlation_node :t1
61
62tux_transform :t1 r1
63set rotation_node :t1:r1
64tux_scale $rotation_node {0 0 0} { 0.35 0.35 0.35 }
65
66#
67# Create torso
68#
69
70tux_transform $rotation_node tors_scl
71set torso_scl "$rotation_node:tors_scl"
72tux_scale $torso_scl {0 0 0} { 0.90 0.9 0.9 }
73
74makeBody $torso_scl
75
76#
77# Create shoulders
78#
79
80tux_transform $rotation_node t2
81set shoulder_xlate "$rotation_node:t2"
82#tux_rotate $shoulder_xlate x 10
83#tux_translate $shoulder_xlate { 0 0.4 0.0 }
84tux_translate $shoulder_xlate { 0 0.4 0.05 }
85
86tux_transform $shoulder_xlate scl
87set shoulder_scale "$shoulder_xlate:scl"
88tux_scale $shoulder_scale {0 0 0} { 0.72 0.72 0.72 }
89
90makeBody $shoulder_scale
91
92#
93# Create neck
94#
95
96tux_transform $rotation_node t3
97set neck_xlate "$rotation_node:t3"
98tux_translate $neck_xlate { 0 0.9 0.07 }
99tux_rotate $neck_xlate y +90
100
101tux_transform $neck_xlate neckjt       ;# neck joint
102set neck_joint "$neck_xlate:neckjt"
103tux_neck $neck_joint
104
105tux_transform $neck_joint t4
106set neck_org "$neck_joint:t4"
107tux_rotate $neck_org y -90
108# leave rotation point at origin
109
110tux_transform $neck_org scl
111set neck_scale "$neck_org:scl"
112tux_scale $neck_scale {0 0 0} { 0.45 0.5 0.45 }
113
114tux_sphere $neck_scale neck 0.8
115set neck "$neck_scale:neck"
116tux_surfaceproperty $neck black_penguin
117
118tux_sphere $neck_scale neckw 0.66
119set neckw "$neck_scale:neckw"
120tux_surfaceproperty $neckw white_penguin
121tux_translate $neckw {0 -0.08 0.35 }
122tux_scale $neckw {0 0 0} {0.8 0.9 0.7}
123tux_shadow $neckw off
124
125#
126# Create head
127#
128
129tux_transform $neck_org t5
130set head_xlate "$neck_org:t5"
131tux_translate $head_xlate { 0 0.3 0.07 }
132tux_rotate $head_xlate y +90
133
134tux_transform $head_xlate hdjtrot
135set head_joint_rot "$head_xlate:hdjtrot"        ;# head joint for rotation
136
137tux_transform $head_joint_rot hdjt
138set head_joint "$head_joint_rot:hdjt"           ;# head joint
139tux_head $head_joint
140
141tux_transform $head_joint hdorg
142set head_org "$head_joint:hdorg"
143tux_rotate $head_org y -90
144tux_translate $head_org {0 0.20 0}
145
146tux_sphere $head_org hd 1.0
147set head "$head_org:hd"
148tux_surfaceproperty $head black_penguin
149tux_scale $head {0 0 0} {0.42 0.5 0.42}
150
151#
152# Create beak
153#
154
155tux_sphere $head_org bk1 0.8
156set beak1 "$head_org:bk1"
157tux_surfaceproperty $beak1 beak_colour
158tux_translate $beak1 { 0 -0.205 0.3 }
159tux_rotate $beak1 x +10
160tux_scale $beak1 {0 0 0} { 0.23 0.12 0.4 }
161
162#tux_sphere $head_org bk2
163#set beak2 "$head_org:bk2"
164#tux_surfaceproperty $beak2 beak_colour
165#tux_translate $beak2 { 0 -0.195 0.3 }
166#tux_rotate $beak2 x +10
167#tux_scale $beak2 {0 0 0} { 0.19 0.15 0.32 }
168#tux_shadow $beak2 off
169
170tux_sphere $head_org bk3 0.66
171set beak3 "$head_org:bk3"
172tux_surfaceproperty $beak3 beak_colour
173tux_translate $beak3 { 0 -0.23 0.3 }
174tux_rotate $beak3 x +10
175tux_scale $beak3 {0 0 0} { 0.21 0.17 0.38 }
176tux_shadow $beak3 off
177
178#
179# Create eyes
180#
181
182tux_sphere $head_org le 0.66
183set left_eye "$head_org:le"
184tux_surfaceproperty $left_eye white_penguin
185tux_translate $left_eye {0.13 -0.03 0.38}
186tux_rotate $left_eye y 18
187tux_rotate $left_eye z 5
188tux_rotate $left_eye x 5
189tux_scale $left_eye {0 0 0} {0.1 0.13 0.03}
190tux_shadow $left_eye off
191
192tux_sphere $head_org re 0.66
193set right_eye "$head_org:re"
194tux_surfaceproperty $right_eye white_penguin
195tux_translate $right_eye {-0.13 -0.03 0.38}
196tux_rotate $right_eye y -18
197tux_rotate $right_eye z -5
198tux_rotate $right_eye x 5
199tux_scale $right_eye {0 0 0} {0.1 0.13 0.03}
200tux_shadow $right_eye off
201
202tux_sphere $head_org li 0.66
203set left_iris "$head_org:li"
204tux_surfaceproperty $left_iris iris_colour
205tux_translate $left_iris {0.12 -0.045 0.40}
206tux_rotate $left_iris y 18
207tux_rotate $left_iris z 5
208tux_rotate $left_iris x 5
209tux_scale $left_iris {0 0 0} {0.055 0.07 0.03}
210tux_shadow $left_iris off
211tux_eye $left_iris left
212
213tux_sphere $head_org ri 0.66
214set right_iris "$head_org:ri"
215tux_surfaceproperty $right_iris iris_colour
216tux_translate $right_iris {-0.12 -0.045 0.40}
217tux_rotate $right_iris y -18
218tux_rotate $right_iris z -5
219tux_rotate $right_iris x 5
220tux_scale $right_iris {0 0 0} {0.055 0.07 0.03}
221tux_shadow $right_iris off
222tux_eye $right_iris right
223
224#
225# Create Upper Arm
226#
227
228# left
229tux_transform $shoulder_xlate luarmxlate
230set luparm_xlate "$shoulder_xlate:luarmxlate"
231tux_rotate $luparm_xlate y 180
232tux_translate $luparm_xlate {-0.56 0.3 0}
233tux_rotate $luparm_xlate z +45
234tux_rotate $luparm_xlate x +90
235
236tux_transform $luparm_xlate lshjt
237set lshoulder_joint "$luparm_xlate:lshjt"       ;# left shoulder joint
238tux_left_shoulder $lshoulder_joint
239
240tux_transform $lshoulder_joint luarmorg
241set luparm_org "$lshoulder_joint:luarmorg"
242tux_rotate $luparm_org x -90
243tux_translate $luparm_org {-0.22 0 0}
244
245tux_sphere $luparm_org uparm 0.66
246set luparm "$luparm_org:uparm"
247tux_surfaceproperty $luparm black_penguin
248tux_scale $luparm {0 0 0} {0.34 0.1 0.2}
249
250#right
251tux_transform $shoulder_xlate ruarmxlate
252set ruparm_xlate "$shoulder_xlate:ruarmxlate"
253tux_translate $ruparm_xlate {-0.56 0.3 0}
254tux_rotate $ruparm_xlate z +45
255tux_rotate $ruparm_xlate x -90
256
257tux_transform $ruparm_xlate rshjt                ;# right shoulder joint
258set rshoulder_joint "$ruparm_xlate:rshjt"
259tux_right_shoulder $rshoulder_joint
260
261tux_transform $rshoulder_joint ruarmorg
262set ruparm_org "$rshoulder_joint:ruarmorg"
263tux_rotate $ruparm_org x +90
264tux_translate $ruparm_org {-0.22 0 0}
265
266tux_sphere $ruparm_org uparm 0.66
267set ruparm "$ruparm_org:uparm"
268tux_surfaceproperty $ruparm black_penguin
269tux_scale $ruparm {0 0 0} {0.34 0.1 0.2}
270
271#
272# Create forearm
273#
274
275# left
276tux_transform $luparm_org llarmxlate
277set llowarm_xlate "$luparm_org:llarmxlate"
278tux_translate $llowarm_xlate {-0.23 0 0}
279tux_rotate $llowarm_xlate z 20
280tux_rotate $llowarm_xlate x +90
281
282tux_transform $llowarm_xlate lelbjt
283set lelbow_joint "$llowarm_xlate:lelbjt"        ;# left elbow joint
284
285tux_transform $lelbow_joint llarmorg
286set llowarm_org "$lelbow_joint:llarmorg"
287tux_rotate $llowarm_org x -90
288tux_translate $llowarm_org {-0.19 0 0}
289
290tux_sphere $llowarm_org llowarm 0.66
291set llowarm "$llowarm_org:llowarm"
292tux_surfaceproperty $llowarm black_penguin
293tux_scale $llowarm {0 0 0} {0.30 0.07 0.15}
294
295# right
296tux_transform $ruparm_org rlarmxlate
297set rlowarm_xlate "$ruparm_org:rlarmxlate"
298tux_translate $rlowarm_xlate {-0.23 0 0}
299tux_rotate $rlowarm_xlate z 20
300tux_rotate $rlowarm_xlate x -90
301
302tux_transform $rlowarm_xlate relbjt              ;# right elbow joint
303set relbow_joint "$rlowarm_xlate:relbjt"
304
305tux_transform $relbow_joint rlarmorg
306set rlowarm_org "$relbow_joint:rlarmorg"
307tux_rotate $rlowarm_org x +90
308tux_translate $rlowarm_org {-0.19 0 0}
309
310tux_sphere $rlowarm_org rlowarm 0.66
311set rlowarm "$rlowarm_org:rlowarm"
312tux_surfaceproperty $rlowarm black_penguin
313tux_scale $rlowarm {0 0 0} {0.30 0.07 0.15}
314
315#
316# Create hands
317#
318
319# left
320tux_transform $llowarm_org lhandxlate
321set lhand_xlate "$llowarm_org:lhandxlate"
322tux_translate $lhand_xlate {-0.24 0 0}
323tux_rotate $lhand_xlate z 20
324tux_rotate $lhand_xlate x +90
325
326tux_transform $lhand_xlate lwrtjt
327set lwrist_joint "$lhand_xlate:lwrtjt"          ;# left wrist joint
328
329tux_transform $lwrist_joint lhndorg
330set lhand_org "$lwrist_joint:lhndorg"
331tux_rotate $lhand_org x -90
332tux_translate $lhand_org {-0.10 0 0}
333
334tux_sphere $lhand_org lhand 0.5
335set lhand "$lhand_org:lhand"
336tux_surfaceproperty $lhand black_penguin
337tux_scale $lhand {0 0 0} {0.12 0.05 0.12}
338
339# right
340tux_transform $rlowarm_org rhandxlate
341set rhand_xlate "$rlowarm_org:rhandxlate"
342tux_translate $rhand_xlate {-0.24 0 0}
343tux_rotate $rhand_xlate z 20
344tux_rotate $rhand_xlate x -90
345
346tux_transform $rhand_xlate rwrtjt
347set rwrist_joint "$rhand_xlate:rwrtjt"          ;# right wrist joint
348
349tux_transform $rwrist_joint rhndorg
350set rhand_org "$rwrist_joint:rhndorg"
351tux_rotate $rhand_org x +90
352tux_translate $rhand_org {-0.10 0 0}
353
354tux_sphere $rhand_org rhand 0.5
355set rhand "$rhand_org:rhand"
356tux_surfaceproperty $rhand black_penguin
357tux_scale $rhand {0 0 0} {0.12 0.05 0.12}
358
359#
360# Make thighs
361#
362
363#left
364tux_transform $rotation_node lthgxlate
365set lthigh_xlate "$rotation_node:lthgxlate"
366tux_rotate $lthigh_xlate y +180
367tux_translate $lthigh_xlate {-0.28 -0.8 0}
368tux_rotate $lthigh_xlate y +110
369
370tux_transform $lthigh_xlate lhipjt               ;# left hip joint
371set lhip_joint "$lthigh_xlate:lhipjt"
372tux_left_hip $lhip_joint
373
374tux_transform $lhip_joint lthgorg
375set lthigh_org "$lhip_joint:lthgorg"
376tux_rotate $lthigh_org y -110
377tux_translate $lthigh_org { 0 -0.1 0 }
378
379tux_sphere $lthigh_org lthigh 0.5
380set lthigh "$lthigh_org:lthigh"
381tux_surfaceproperty $lthigh beak_colour
382tux_scale $lthigh {0 0 0} {0.07 0.30 0.07}
383
384tux_sphere $lthigh_org lhipball 0.5
385set lhipball "$lthigh_org:lhipball"
386tux_surfaceproperty $lhipball black_penguin
387tux_translate $lhipball {0.0 0.05 0.0}
388tux_scale $lhipball {0 0 0} {0.09 0.18 0.09}
389tux_shadow $lhipball off
390
391#right
392tux_transform $rotation_node rthgxlate
393set rthigh_xlate "$rotation_node:rthgxlate"
394tux_translate $rthigh_xlate {-0.28 -0.8 0}
395tux_rotate $rthigh_xlate y -110
396
397tux_transform $rthigh_xlate rhipjt               ;# right hip joint
398set rhip_joint "$rthigh_xlate:rhipjt"
399tux_right_hip $rhip_joint
400
401tux_transform $rhip_joint rthgorg
402set rthigh_org "$rhip_joint:rthgorg"
403tux_rotate $rthigh_org y +110
404tux_translate $rthigh_org { 0 -0.1 0 }
405
406tux_sphere $rthigh_org rthigh 0.5
407set rthigh "$rthigh_org:rthigh"
408tux_surfaceproperty $rthigh beak_colour
409tux_scale $rthigh {0 0 0} {0.07 0.30 0.07}
410
411tux_sphere $rthigh_org rhipball 0.5
412set rhipball "$rthigh_org:rhipball"
413tux_surfaceproperty $rhipball black_penguin
414tux_translate $rhipball {0.0 0.05 0.0}
415tux_scale $rhipball {0 0 0} {0.09 0.18 0.09}
416tux_shadow $rhipball off
417
418#
419# Make calves
420#
421
422#left
423tux_transform $lthigh_org lclfxlate
424set lcalf_xlate "$lthigh_org:lclfxlate"
425tux_translate $lcalf_xlate {0 -0.21 0}
426tux_rotate $lcalf_xlate y +90
427
428tux_transform $lcalf_xlate lkneejt               ;# left knee joint
429set lknee_joint "$lcalf_xlate:lkneejt"
430tux_left_knee $lknee_joint
431
432tux_transform $lknee_joint lclforg
433set lcalf_org "$lknee_joint:lclforg"
434tux_rotate $lcalf_org y -90
435tux_translate $lcalf_org { 0 -0.13 0 }
436
437tux_sphere $lcalf_org lcalf 0.5
438set lcalf "$lcalf_org:lcalf"
439tux_surfaceproperty $lcalf beak_colour
440tux_scale $lcalf {0 0 0} {0.06 0.18 0.06}
441
442#right
443tux_transform $rthigh_org rclfxlate
444set rcalf_xlate "$rthigh_org:rclfxlate"
445tux_translate $rcalf_xlate {0 -0.21 0}
446tux_rotate $rcalf_xlate y -90
447
448tux_transform $rcalf_xlate rkneejt               ;# right knee joint
449set rknee_joint "$rcalf_xlate:rkneejt"
450tux_right_knee $rknee_joint
451
452tux_transform $rknee_joint rclforg
453set rcalf_org "$rknee_joint:rclforg"
454tux_rotate $rcalf_org y +90
455tux_translate $rcalf_org { 0 -0.13 0 }
456
457tux_sphere $rcalf_org rcalf 0.5
458set rcalf "$rcalf_org:rcalf"
459tux_surfaceproperty $rcalf beak_colour
460tux_scale $rcalf {0 0 0} {0.06 0.18 0.06}
461
462
463#
464# Create feet
465#
466
467# helper function to make feet
468proc makeFoot { parent } {
469    tux_transform $parent footorg
470
471    set foot_org "$parent:footorg"
472    tux_translate $foot_org { -0.13 0 0 }
473    tux_surfaceproperty $foot_org beak_colour
474    tux_scale $foot_org { 0 0 0 } { 1.1 1.0 1.3 }
475
476    tux_sphere $foot_org base 0.66
477    set foot_base "$foot_org:base"
478    tux_scale $foot_base {0 0 0} {0.25 0.08 0.18}
479
480    tux_sphere $foot_org toe1 0.66
481    set toe1 "$foot_org:toe1"
482    tux_surfaceproperty $toe1 beak_colour
483    tux_translate $toe1 {-0.07 0 0.1}
484    tux_rotate $toe1 y 30
485    tux_scale $toe1 {0 0 0} {0.27 0.07 0.11}
486
487    tux_sphere $foot_org toe2 0.66
488    set toe2 "$foot_org:toe2"
489    tux_surfaceproperty $toe2 beak_colour
490    tux_translate $toe2 {-0.07 0 -0.1}
491    tux_rotate $toe2 y -30
492    tux_scale $toe2 {0 0 0} {0.27 0.07 0.11}
493
494    tux_sphere $foot_org toe3 0.66
495    set toe3 "$foot_org:toe3"
496    tux_surfaceproperty $toe3 beak_colour
497    tux_translate $toe3 {-0.08 0 0}
498    tux_scale $toe3 {0 0 0} {0.27 0.07 0.10}
499}
500
501# left foot
502tux_transform $lcalf_org lftxlate
503set lfoot_xlate "$lcalf_org:lftxlate"
504tux_translate $lfoot_xlate { 0 -0.18 0 }
505tux_rotate $lfoot_xlate y -50
506
507tux_transform $lfoot_xlate lankjt
508set lankle_joint "$lfoot_xlate:lankjt"          ;# left ankle joint
509tux_left_ankle $lankle_joint
510
511makeFoot $lankle_joint
512
513# right foot
514tux_transform $rcalf_org rftxlate
515set rfoot_xlate "$rcalf_org:rftxlate"
516tux_translate $rfoot_xlate { 0 -0.18 0 }
517tux_rotate $rfoot_xlate y +50
518
519tux_transform $rfoot_xlate rankjt
520set rankle_joint "$rfoot_xlate:rankjt"          ;# right ankle joint
521tux_right_ankle $rankle_joint
522
523makeFoot $rankle_joint
524
525#
526# Create Tail
527#
528tux_transform $rotation_node tailxlate
529set tail_xlate "$rotation_node:tailxlate"
530tux_translate $tail_xlate {0 -0.4 -0.5}
531tux_rotate $tail_xlate x -60
532
533tux_transform $tail_xlate tail_joint
534set tail_joint "$tail_xlate:tail_joint"         ;# tail joint
535tux_tail $tail_joint
536
537tux_transform $tail_joint tail_orig
538set tail_orig "$tail_joint:tail_orig"
539tux_translate $tail_orig {0 0.15 0}
540
541tux_sphere $tail_orig tail 0.5
542set tail "$tail_orig:tail"
543tux_surfaceproperty $tail black_penguin
544tux_scale $tail {0 0 0} {0.2 0.3 0.1}
545
546