home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Late Night VRML 2.0 with Java CD-ROM
/
code.zip
/
Ch20
/
nodman.wrl
< prev
next >
Wrap
Text File
|
1997-03-24
|
8KB
|
312 lines
#VRML V2.0 utf8
PROTO Segment [
field SFVec3f loc 0 0 0
field SFFloat length 0.1
field SFVec3f displacement 0 0.05 0
field SFRotation rot 0 0 1 0
]
{
Transform {
translation IS loc
children [
Shape {
geometry Sphere { radius 0.05 }
appearance Appearance {
material Material {
diffuseColor 1 0 0
}
}
}
Transform {
rotation IS rot
translation IS displacement
children [
Shape {
geometry Cylinder {
radius 0.025
height IS length
}
appearance Appearance {
material Material {
diffuseColor 0 1 0
}
}
}
]
}
]
}
}
DEF wholeBody Transform {
children [
DEF pelvis Transform {
center 0 0.8 0
children [
Transform {
translation 0 0.8 0
children [
Shape {
geometry Sphere { radius 0.05 }
appearance Appearance {
material Material {
diffuseColor 1 0 0
}
}
}
Transform {
rotation 0 0 1 1.5708
children [
Shape {
geometry Cylinder { radius 0.025 height 0.6 }
appearance DEF App Appearance {
material Material {
diffuseColor 0 1 0
}
}
}
]
}
Transform {
translation 0 0.05 0
children [
Shape {
geometry Cylinder { radius 0.025 height 0.1 }
appearance USE App
}
]
}
]
}
DEF l_hip Transform {
center 0.3 0.8 0
children [
Segment {
loc 0.3 0.8 0
length 0.4
displacement 0 -0.2 0
}
DEF l_knee Transform {
center 0.3 0.4 0
children [
Segment {
loc 0.3 0.4 0
length 0.4
displacement 0 -0.2 0
}
DEF l_ankle Transform {
center 0.3 0 0
children [
Segment { # left foot
loc 0.3 0 0
length 0.15
displacement 0 0 0.075
rot 1 0 0 1.5708
}
]
}
]
}
]
}
DEF r_hip Transform {
center -0.3 0.8 0
children [
Segment {
loc -0.3 0.8 0
length 0.4
displacement 0 -0.2 0
}
DEF r_knee Transform {
center -0.3 0.4 0
children [
Segment {
loc -0.3 0.4 0
length 0.4
displacement 0 -0.2 0
}
DEF r_ankle Transform {
center -0.3 0 0
children [
Segment { # left foot
loc -0.3 0 0
length 0.15
displacement 0 0 0.075
rot 1 0 0 1.5708
}
]
}
]
}
]
}
DEF v1 Transform {
center 0 0.9 0
children [
Segment { loc 0 0.9 0 }
DEF v2 Transform {
center 0 1.0 0
children [
Segment { loc 0 1.0 0 }
DEF v3 Transform {
center 0 1.1 0
children [
Segment { loc 0 1.1 0 }
DEF v4 Transform {
center 0 1.2 0
children [
Segment { loc 0 1.2 0 }
DEF v5 Transform {
center 0 1.3 0
children [
Segment { loc 0 1.3 0 }
Segment { # left shoulder
loc 0 1.4 0
length 0.4
displacement 0.2 0 0
rot 0 0 1 1.5708
}
DEF l_shoulder Transform {
center 0.4 1.4 0
children [
Segment { # left upper arm
loc 0.4 1.4 0
length 0.3
displacement 0 -0.2 0
}
DEF l_elbow Transform {
center 0.4 1.1 0
children [
Segment { # left forearm
loc 0.4 1.1 0
length 0.3
displacement 0 -0.15 0
}
DEF l_wrist Transform {
center 0.4 0.8 0
children [
Segment { # left hand
loc 0.4 0.8 0
length 0.15
displacement 0 -0.075 0
}
]
}
]
}
]
}
Segment { # right shoulder
loc 0 1.4 0
length 0.4
displacement -0.2 0 0
rot 0 0 1 -1.5708
}
DEF r_shoulder Transform {
center -0.4 1.4 0
children [
Segment { # right upper arm
loc -0.4 1.4 0
length 0.3
displacement 0 -0.2 0
}
DEF r_elbow Transform {
center -0.4 1.1 0
children [
Segment { # right forearm
loc -0.4 1.1 0
length 0.3
displacement 0 -0.15 0
}
DEF r_wrist Transform {
center -0.4 0.8 0
children [
Segment { # left hand
loc -0.4 0.8 0
length 0.15
displacement 0 -0.075 0
}
]
}
]
}
]
}
DEF v6 Transform {
center 0 1.4 0
children [
Segment { loc 0 1.4 0 }
DEF v7 Transform {
center 0 1.5 0
children [
Segment { loc 0 1.5 0 }
DEF v8 Transform {
center 0 1.6 0
children [
Segment { loc 0 1.6 0 }
Transform {
translation 0 1.8 0
children [
Shape {
geometry Sphere { radius 0.2 }
appearance Appearance {
material Material {
diffuseColor 0 0 1
}
}
}
Transform {
rotation 1 0 0 1.5708
translation 0 0 0.2
children [
Shape {
geometry Cone { bottomRadius 0.1 height 0.1 }
appearance Appearance {
material Material {
diffuseColor 1 1 0
}
}
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
Viewpoint { position 0 1 3 }
NavigationInfo { type "EXAMINE" }
#VRML V2.0 utf8
# A simple head-nodding animation, created by hand
DEF TS TimeSensor { loop TRUE }
DEF INTER OrientationInterpolator {
key [ 0 0.25 0.75 1.0 ]
keyValue [ 1 0 0 0, 1 0 0 0.7805, 1 0 0 0.7804, 1 0 0 0 ]
}
ROUTE TS.fraction_changed TO INTER.set_fraction
ROUTE INTER.value_changed TO v8.set_rotation