home *** CD-ROM | disk | FTP | other *** search
/ Late Night VRML 2.0 with Java CD-ROM / code.zip / Ch20 / stickman.wrl < prev    next >
Text File  |  1997-03-24  |  7KB  |  299 lines

  1. #VRML V2.0 utf8
  2.  
  3. PROTO Segment [
  4.     field SFVec3f loc 0 0 0
  5.     field SFFloat length 0.1
  6.     field SFVec3f displacement 0 0.05 0
  7.     field SFRotation rot 0 0 1 0
  8. ]
  9. {
  10.     Transform {
  11.         translation IS loc
  12.         children [
  13.             Shape {
  14.                 geometry Sphere { radius 0.05 }
  15.                 appearance Appearance {
  16.                     material Material {
  17.                         diffuseColor 1 0 0
  18.                     }
  19.                 }
  20.             }
  21.             Transform {
  22.                 rotation IS rot
  23.                 translation IS displacement
  24.                 children [
  25.                     Shape {
  26.                         geometry Cylinder {
  27.                             radius 0.025
  28.                             height IS length
  29.                         }
  30.                         appearance Appearance {
  31.                             material Material {
  32.                                 diffuseColor 0 1 0
  33.                             }
  34.                         }
  35.                     }
  36.                 ]
  37.             }
  38.         ]
  39.     }
  40. }
  41.  
  42. DEF wholeBody Transform {
  43.     children [
  44.         DEF pelvis Transform {
  45.             center 0 0.8 0
  46.             children [
  47.                 Transform {
  48.                     translation 0 0.8 0
  49.                     children [
  50.                         Shape {
  51.                             geometry Sphere { radius 0.05 }
  52.                             appearance Appearance {
  53.                                 material Material {
  54.                                     diffuseColor 1 0 0
  55.                                 }
  56.                             }
  57.                         }
  58.                         Transform {
  59.                             rotation 0 0 1 1.5708
  60.                             children [
  61.                                 Shape {
  62.                                     geometry Cylinder { radius 0.025 height 0.6 }
  63.                                     appearance DEF App Appearance {
  64.                                         material Material {
  65.                                             diffuseColor 0 1 0
  66.                                         }
  67.                                     }
  68.                                 }
  69.                             ]
  70.                         }
  71.                         Transform {
  72.                             translation 0 0.05 0
  73.                             children [
  74.                                 Shape {
  75.                                     geometry Cylinder { radius 0.025 height 0.1 }
  76.                                     appearance USE App
  77.                                 }
  78.                             ]
  79.                         }
  80.                     ]
  81.                 }
  82.                 DEF l_hip Transform {
  83.                     center 0.3 0.8 0
  84.                     children [
  85.                         Segment {
  86.                             loc 0.3 0.8 0
  87.                             length 0.4
  88.                             displacement 0 -0.2 0
  89.                         }
  90.                         DEF l_knee Transform {
  91.                             center 0.3 0.4 0
  92.                             children [
  93.                                 Segment {
  94.                                     loc 0.3 0.4 0
  95.                                     length 0.4
  96.                                     displacement 0 -0.2 0
  97.                                 }
  98.                                 DEF l_ankle Transform {
  99.                                     center 0.3 0 0
  100.                                     children [
  101.                                         Segment {  # left foot
  102.                                             loc 0.3 0 0
  103.                                             length 0.15
  104.                                             displacement 0 0 0.075
  105.                                             rot 1 0 0 1.5708
  106.                                         }
  107.                                     ]
  108.                                 }
  109.                             ]
  110.                         }
  111.                     ]
  112.                 }
  113.                 DEF r_hip Transform {
  114.                     center -0.3 0.8 0
  115.                     children [
  116.                         Segment {
  117.                             loc -0.3 0.8 0
  118.                             length 0.4
  119.                             displacement 0 -0.2 0
  120.                         }
  121.                         DEF r_knee Transform {
  122.                             center -0.3 0.4 0
  123.                             children [
  124.                                 Segment {
  125.                                     loc -0.3 0.4 0
  126.                                     length 0.4
  127.                                     displacement 0 -0.2 0
  128.                                 }
  129.                                 DEF r_ankle Transform {
  130.                                     center -0.3 0 0
  131.                                     children [
  132.                                         Segment {  # left foot
  133.                                             loc -0.3 0 0
  134.                                             length 0.15
  135.                                             displacement 0 0 0.075
  136.                                             rot 1 0 0 1.5708
  137.                                         }
  138.                                     ]
  139.                                 }
  140.                             ]
  141.                         }
  142.                     ]
  143.                 }
  144.                 DEF v1 Transform {
  145.                     center 0 0.9 0
  146.                     children [
  147.                         Segment { loc 0 0.9 0 }
  148.                         DEF v2 Transform {
  149.                             center 0 1.0 0
  150.                             children [
  151.                                 Segment { loc 0 1.0 0 }
  152.                                 DEF v3 Transform {
  153.                                     center 0 1.1 0
  154.                                     children [
  155.                                         Segment { loc 0 1.1 0 }
  156.                                         DEF v4 Transform {
  157.                                             center 0 1.2 0
  158.                                             children [
  159.                                                 Segment { loc 0 1.2 0 }
  160.                                                 DEF v5 Transform {
  161.                                                     center 0 1.3 0
  162.                                                     children [
  163.                                                         Segment { loc 0 1.3 0 }
  164.                                                         Segment {  # left shoulder
  165.                                                             loc 0 1.4 0
  166.                                                             length 0.4
  167.                                                             displacement 0.2 0 0
  168.                                                             rot 0 0 1 1.5708
  169.                                                         }
  170.                                                         DEF l_shoulder Transform {
  171.                                                             center 0.4 1.4 0
  172.                                                             children [
  173.                                                                 Segment {  # left upper arm
  174.                                                                     loc 0.4 1.4 0
  175.                                                                     length 0.3
  176.                                                                     displacement 0 -0.15 0
  177.                                                                 }
  178.                                                                 DEF l_elbow Transform {
  179.                                                                     center 0.4 1.1 0
  180.                                                                     children [
  181.                                                                         Segment { # left forearm
  182.                                                                             loc 0.4 1.1 0
  183.                                                                             length 0.3
  184.                                                                             displacement 0 -0.15 0
  185.                                                                         }
  186.                                                                         DEF l_wrist Transform {
  187.                                                                             center 0.4 0.8 0
  188.                                                                             children [
  189.                                                                                 Segment {  # left hand
  190.                                                                                     loc 0.4 0.8 0
  191.                                                                                     length 0.15
  192.                                                                                     displacement 0 -0.075 0
  193.                                                                                 }
  194.                                                                             ]
  195.                                                                         }
  196.                                                                     ]
  197.                                                                 }
  198.                                                             ]
  199.                                                         }
  200.                                                         Segment {  # right shoulder
  201.                                                             loc 0 1.4 0
  202.                                                             length 0.4
  203.                                                             displacement -0.2 0 0
  204.                                                             rot 0 0 1 -1.5708
  205.                                                         }
  206.                                                         DEF r_shoulder Transform {
  207.                                                             center -0.4 1.4 0
  208.                                                             children [
  209.                                                                 Segment {  # right upper arm
  210.                                                                     loc -0.4 1.4 0
  211.                                                                     length 0.3
  212.                                                                     displacement 0 -0.15 0
  213.                                                                 }
  214.                                                                 DEF r_elbow Transform {
  215.                                                                     center -0.4 1.1 0
  216.                                                                     children [
  217.                                                                         Segment { # right forearm
  218.                                                                             loc -0.4 1.1 0
  219.                                                                             length 0.3
  220.                                                                             displacement 0 -0.15 0
  221.                                                                         }
  222.                                                                         DEF r_wrist Transform {
  223.                                                                             center -0.4 0.8 0
  224.                                                                             children [
  225.                                                                                 Segment {  # left hand
  226.                                                                                     loc -0.4 0.8 0
  227.                                                                                     length 0.15
  228.                                                                                     displacement 0 -0.075 0
  229.                                                                                 }
  230.                                                                             ]
  231.                                                                         }
  232.                                                                     ]
  233.                                                                 }
  234.                                                             ]
  235.                                                         }
  236.                                                         DEF v6 Transform {
  237.                                                             center 0 1.4 0
  238.                                                             children [
  239.                                                                 Segment { loc 0 1.4 0 }
  240.                                                                 DEF v7 Transform {
  241.                                                                     center 0 1.5 0
  242.                                                                     children [
  243.                                                                         Segment { loc 0 1.5 0 }
  244.                                                                         DEF v8 Transform {
  245.                                                                             center 0 1.6 0
  246.                                                                             children [
  247.                                                                                 Segment { loc 0 1.6 0 }
  248.                                                                                 Transform {
  249.                                                                                     translation 0 1.8 0
  250.                                                                                     children [
  251.                                                                                         Shape {
  252.                                                                                             geometry Sphere { radius 0.2 }
  253.                                                                                             appearance Appearance {
  254.                                                                                                 material Material {
  255.                                                                                                     diffuseColor 0 0 1
  256.                                                                                                 }
  257.                                                                                             }
  258.                                                                                         }
  259.                                                                                         Transform {
  260.                                                                                             rotation 1 0 0 1.5708
  261.                                                                                             translation 0 0 0.2
  262.                                                                                             children [
  263.                                                                                                 Shape {
  264.                                                                                                     geometry Cone { bottomRadius 0.1 height 0.1 }
  265.                                                                                                     appearance Appearance {
  266.                                                                                                         material Material {
  267.                                                                                                             diffuseColor 1 1 0
  268.                                                                                                         }
  269.                                                                                                     }
  270.                                                                                                 }
  271.                                                                                             ]
  272.                                                                                         }
  273.                                                                                     ]
  274.                                                                                 }
  275.                                                                             ]
  276.                                                                         }
  277.                                                                     ]
  278.                                                                 }
  279.                                                             ]
  280.                                                         }
  281.                                                     ]
  282.                                                 }
  283.                                             ]
  284.                                         }
  285.                                     ]
  286.                                 }
  287.                             ]
  288.                         }
  289.                     ]
  290.                 }
  291.             ]
  292.         }
  293.     ]
  294. }
  295.  
  296. Viewpoint { position 0 1 3 }
  297.  
  298. NavigationInfo { type "EXAMINE" }
  299.