Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

1

LUCRAREA NR. 5

Urmtorul program prezint utilizarea nodurilor folosite pentru animaie:
Programul principal este urmtorul:
#VRML V2.0 utf8
Group {
children [
DEF Entry Viewpoint {
position 0.0 3.1 10.0
description "Entry View" },
NavigationInfo {
avatarSize [ 0.5, 3.0, 1.5 ]
headlight FALSE },
DEF Proximity ProximitySensor {
size 10.0 10.0 50.0 },
PointLight {
ambientIntensity 0.0
color 0.6 0.6 0.6
location 0.0 6.0 -8.0 },
DirectionalLight {
ambientIntensity 0.0
color 0.0 0.15 0.5
direction 1.0 -1.0 -4.0 },
DirectionalLight {
ambientIntensity 0.0
intensity 1.5
color 1.0 0.0 0.0
direction -1.0 2.5 -1.0 },
Transform {
translation 0.0 -0.5 8.0
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 0.8 0.8 0.8 }
texture DEF Granit ImageTexture {
url "granit_g.jpg" }
textureTransform TextureTransform {
scale 0.5 0.5 } }
geometry Box {
size 4.0 0.4 16.0 } }, ] },
DEF Stair1 Transform {
translation 0.0 0.0 0.0
children [
DEF Stair Inline {
url "tread.wrl" }, ] },
Transform {
translation -1.0 0.5 -2.0
children [
DEF Stair2 Transform {
translation 0.0 0.0 0.0
children [ USE Stair ] } ] },
Transform {
translation 1.5 1.0 -4.0
children [
DEF Stair3 Transform {
translation 0.0 0.0 0.0
children [ USE Stair ] } ] },
Transform {
translation 0.0 1.5 -6.0
children [
2
DEF Stair4 Transform {
translation 0.0 0.0 0.0
children [ USE Stair ] } ] },
Transform {
translation 0.0 2.0 -8.0
children [ USE Stair ] },
Transform {
translation 0.0 2.0 -10.0
scale 0.7 0.7 0.7
children [
Inline {
url "glowdoor.wrl" } ] },
Transform {
translation -2.0 6.0 -10.0
rotation 0.0 0.0 1.0 0.785
children [
DEF ArchBox Shape {
appearance Appearance {
material Material {
ambientIntensity 0.0
diffuseColor 1.0 1.0 1.0
emissiveColor 0.4 0.4 0.4 }
texture ImageTexture {
url "marble_g.jpg" } }
geometry Box {
size 4.0 0.2 2.0 } },
Transform {
translation 1.0 0.2 1.0
children [ USE ArchBox ] },
Transform {
translation 2.0 0.4 2.0
children [ USE ArchBox ] }, ] },
Transform {
translation 2.0 6.0 -10.0
rotation 0.0 0.0 1.0 -0.785
children [
USE ArchBox,
Transform {
translation -1.0 0.2 1.0
children [ USE ArchBox ] },
Transform {
translation -2.0 0.4 2.0
children [ USE ArchBox ] }, ] },
Transform {
translation 0.0 7.0 0.0
scale 1.0 2.0 1.0
children [
Inline {
url "redwall.wrl" }, ] }, ] }
# Controlul animaiei
DEF Stair1Timer TimeSensor {
cycleInterval 4.0
loop TRUE }
DEF Stair1Path PositionInterpolator {
key [ 0.0, 0.25, 0.5, 0.75, 1.0 ]
keyValue [ 0.0 0.0 0.0, 3.0 0.0 0.0, 0.0 0.0 0.0, -3.0 0.0 0.0, 0.0 0.0 0.0 ] }
ROUTE Proximity.enterTime TO Stair1Timer.set_startTime
ROUTE Stair1Timer.fraction_changed TO Stair1Path.set_fraction
ROUTE Stair1Path.value_changed TO Stair1.set_translation
DEF Stair2Timer TimeSensor {
cycleInterval 4.0
3
loop TRUE }
DEF Stair2Path PositionInterpolator {
key [ 0.0, 0.25, 0.5, 0.75, 1.0 ]
keyValue [ 3.0 0.0 0.0, 0.0 0.0 0.0, -3.0 0.0 0.0, 0.0 0.0 0.0, 3.0 0.0 0.0 ] }
ROUTE Proximity.enterTime TO Stair2Timer.set_startTime
ROUTE Stair2Timer.fraction_changed TO Stair2Path.set_fraction
ROUTE Stair2Path.value_changed TO Stair2.set_translation
DEF Stair3Timer TimeSensor {
cycleInterval 4.0
loop TRUE }
DEF Stair3Path PositionInterpolator {
key [ 0.0, 0.25, 0.5, 0.75, 1.0 ]
keyValue [ -3.0 0.0 0.0, 0.0 0.0 0.0, 3.0 0.0 0.0, 0.0 0.0 0.0, -3.0 0.0 0.0 ] }
ROUTE Proximity.enterTime TO Stair3Timer.set_startTime
ROUTE Stair3Timer.fraction_changed TO Stair3Path.set_fraction
ROUTE Stair3Path.value_changed TO Stair3.set_translation
DEF Stair4Timer TimeSensor {
cycleInterval 4.0
loop TRUE }
DEF Stair4Path PositionInterpolator {
key [ 0.0, 0.25, 0.5, 0.75, 1.0 ]
keyValue [ 0.0 0.0 0.0, -3.0 0.0 0.0, 0.0 0.0 0.0, 3.0 0.0 0.0, 0.0 0.0 0.0 ] }
ROUTE Proximity.enterTime TO Stair4Timer.set_startTime
ROUTE Stair4Timer.fraction_changed TO Stair4Path.set_fraction
ROUTE Stair4Path.value_changed TO Stair4.set_translation

Fiierul tread.wrl are urmtorul program:
#VRML V2.0 utf8
Group {
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 1.0 1.0 1.0 }
texture ImageTexture {
url "granit_g.jpg" }
textureTransform TextureTransform {
scale 0.25 0.25 } }
geometry Box {
size 10.0 0.4 2.0 } },
Transform {
translation -4.0 1.0 0.0
children [
DEF Ball Shape {
appearance Appearance {
material Material {
ambientIntensity 0.0
diffuseColor 1.0 1.0 1.0
specularColor 0.7 0.7 0.7
shininess 0.2 }
texture DEF Marble ImageTexture {
url "marble_g.jpg" } }
geometry Sphere {
radius 1.0 } } ] },
Transform {
translation -4.0 2.0 0.0
children [
DEF Pyramid Shape {
appearance Appearance {
material Material {
ambientIntensity 0.0
4
diffuseColor 1.0 1.0 1.0
specularColor 0.7 0.7 0.7
shininess 0.2 }
texture USE Marble }
geometry IndexedFaceSet {
coord Coordinate {
point [
-0.8 0.0 0.8, 0.8 0.0 0.8, 0.8 0.0 -0.8, -0.8 0.0 -0.8, 0.0 4.0 0.0, ] }
coordIndex [
0, 3, 2, 1, -1, 0, 1, 4, -1, 1, 2, 4, -1, 2, 3, 4, -1, 3, 0, 4, -1, ]
texCoord TextureCoordinate {
point [
0.0 0.2, 1.0 0.2, 0.5 1.0,
0.0 0.0, 1.0 0.0, 1.0 1.0, 0.0 1.0, ] }
texCoordIndex [
3, 4, 5, 6, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, ] } } ] },
Transform {
translation 4.0 1.0 0.0
children [ USE Ball ] },
Transform {
translation 4.0 2.0 0.0
children [ USE Pyramid ] }, ] }

Programul glowdoor.wrl este urmtorul:
#VRML V2.0 utf8
Group {
children [
Shape {
appearance Appearance {
material Material {
ambientIntensity 0.0
diffuseColor 0.0 0.0 0.0
emissiveColor 1.0 1.0 1.0 }
texture ImageTexture {
url "fire_g.jpg" }
textureTransform TextureTransform {
translation 0.1 0.1
scale 0.7 1.0 } }
geometry IndexedFaceSet {
coord Coordinate {
point [
1.50 0.00 0.01, 1.50 4.50 0.01, 1.39 5.07 0.01, 1.06 5.56 0.01, 0.57 5.89 0.01,
0.00 6.00 0.01, -0.57 5.89 0.01, -1.06 5.56 0.01, -1.39 5.07 0.01, -1.50 4.50 0.01,
-1.50 0.00 0.00, 1.50 0.00 -0.41, 1.50 4.50 -0.41, 1.39 5.07 -0.41, 1.06 5.56 -0.41,
0.57 5.89 -0.41, 0.00 6.00 -0.41, -0.57 5.89 -0.41, -1.06 5.56 -0.41, -1.39 5.07 -0.41,
-1.50 4.50 -0.41, -1.50 0.00 -0.40, ] }
solid TRUE
coordIndex [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, -1,
0, 11, 12, 1, -1, 1, 12, 13, 2, -1, 2, 13, 14, 3, -1, 3, 14, 15, 4, -1, 4, 15, 16, 5, -1,
5, 16, 17, 6, -1, 6, 17, 18, 7, -1, 7, 18, 19, 8, -1, 8, 19, 20, 9, -1, 9, 20, 21, 10, -1, ] }},
Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.2 0.2 0.2
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
5
1.3 2.2 0.02, 1.3 3.2 0.02, 0.9 3.2 0.02, 0.9 2.2 0.02, 1.15 3.1 0.02,
1.15 2.9 0.2, 1.15 2.5 0.2, 1.15 2.3 0.02, 1.15 3 0.02, 1.15 2.85 0.13,
1.15 2.55 0.13, 1.15 2.4 0.02, 1.05 3.1 0.02, 1.05 2.9 0.2, 1.05 2.5 0.2,
1.05 2.3 0.02, 1.05 3 0.02, 1.05 2.85 0.13, 1.05 2.55 0.13, 1.05 2.4 0.02 ] }
solid FALSE
coordIndex [
0, 1, 2, 3, -1, 4, 12, 13, 5, -1, 5, 13, 14, 6, -1, 6, 14, 15, 7, -1, 8, 4, 5, 9, -1, 9, 5, 6, 10, -1, 10, 6,
7, 11, -1, 16, 17, 13, 12, -1, 17, 18, 14, 13, -1, 18, 19, 15, 14, -1 ] } } ] }

Programul redwall.wrl este urmtorul:
#VRML V2.0 utf8
Shape {
appearance Appearance {
material Material {
emissiveColor 1.0 0.0 0.0
diffuseColor 0.0 0.0 0.0
}
texture ImageTexture {
url "sky_g.jpg" } }
geometry IndexedFaceSet {
coord Coordinate {
point [
20.00 -10.00 0.00, 20.00 10.00 0.00, 18.02 -10.00 -8.68, 18.02 10.00 -8.68,
12.47 -10.00 -15.64, 12.47 10.00 -15.64, 4.45 -10.00 -19.50, 4.45 10.00 -19.50,
-4.45 -10.00 -19.50, -4.45 10.00 -19.50, -12.47 -10.00 -15.64, -12.47 10.00 -15.64,
-18.02 -10.00 -8.68, -18.02 10.00 -8.68, -20.00 -10.00 0.00, -20.00 10.00 0.00,
] }
coordIndex [
0, 1, 3, 2, -1, 2, 3, 5, 4, -1, 4, 5, 7, 6, -1, 6, 7, 9, 8, -1, 8, 9, 11, 10, -1,
10, 11, 13, 12, -1, 12, 13, 15, 14, -1, ]
texCoord TextureCoordinate {
point [
180.000000 0.000000, 180.000000 1.000000, 179.857143 0.000000,
179.857143 1.000000, 179.714286 0.000000, 179.714286 1.000000,
179.571429 0.000000, 179.571429 1.000000, 179.428571 0.000000,
179.428571 1.000000, 179.285714 0.000000, 179.285714 1.000000,
179.142857 0.000000, 179.142857 1.000000, 179.000000 0.000000,
179.000000 1.000000, ] }
texCoordIndex [
0, 1, 3, 2, -1, 2, 3, 5, 4, -1, 4, 5, 7, 6, -1, 6, 7, 9, 8, -1, 8, 9, 11, 10, -1,
10, 11, 13, 12, -1, 12, 13, 15, 14, -1, ]
solid TRUE
convex FALSE
creaseAngle 0.785
} }

You might also like