Multimedia Authoring

Group vr0709

Aemro Amare & Alessandro Bertacco


Product in an appropriate environment Source Code

3D view
home page

There are some troube in the conversion from source code to html, the source seems to be not idented. For a better view, it's possible to download the code in a simple text format [ click here ].

Try to see if our 3D model looks like to our real kitchen (see the photo below;).

#VRML V2.0 utf8 WorldInfo { title "Simple Product" info "Aemro & Ale Group" } NavigationInfo { type "WALK" avatarSize [1, 60, 10] } Viewpoint { position 0 60 40 #orientation -1 0 0 .30 fieldOfView 1 } Background { skyAngle [1 1.57 3.14] skyColor [0 0 1, 0 0 1, .6 .6 1, 0 0 1] groundAngle [1 1.57] groundColor [0 1 0, 0 .8 0, 0 .6 0] } EXTERNPROTO pproduct [ exposedField SFVec3f translation exposedField SFVec3f translation_mess exposedField MFString mess_title exposedField SFColor mess_color exposedField SFVec3f scale exposedField SFRotation rotation exposedField MFString string ][ "product_action.wrl#product" ] #spazzatura PROTO spazzatura [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ Shape { geometry Cylinder { radius 8 height 20 bottom TRUE top FALSE } appearance Appearance { texture ImageTexture { url "spazzatura.jpg" } } } Transform { translation 0 8 0 children [ Shape { geometry Cylinder { radius 7.5 height 1 bottom TRUE top TRUE } appearance Appearance { texture ImageTexture { url "spazzatura_dentro.jpg" } } } ] } ] } } #frigo PROTO frigo [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 exposedField MFString interno "frigo_1.jpg" exposedField MFString esterno "frigo_2.jpg" ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ Shape { geometry Box { size 20 25 20 } appearance DEF AppFrigo Appearance { material Material { diffuseColor .9 .9 .9 } } } Transform { translation .25 .25 10.1 children [ Shape { geometry Box { size 18 23 0.1 } appearance Appearance { texture ImageTexture { url IS interno } } } ] } #porta frigo Transform { translation 10 0 10.2 children [ DEF FRIGOTIMEOPEN TimeSensor { cycleInterval 1 loop FALSE startTime -1 } DEF FRIGOTIMECLOSE TimeSensor { cycleInterval 1 loop FALSE startTime -1 } DEF INTFRIGOOPEN OrientationInterpolator { key [0, 1] keyValue [ 0 1 0 0, 0 1 0 1.9 ] } DEF INTFRIGOCLOSE OrientationInterpolator { key [0, 1] keyValue [ 0 1 0 1.9, 0 1 0 0 ] } DEF FRIGOSENS TouchSensor { } DEF FRIGO Transform { children [ Transform { translation -9.75 .25 0 children [ Shape { geometry Box { size 18 23 0.1 } appearance Appearance { texture ImageTexture { url IS esterno } } } ] } Transform { translation -10 0 .3 children [ Shape { geometry Box { size 20 25 .5 } appearance USE AppFrigo } ] } #maniglia Transform { translation -17.5 7.5 2.3 children [ Shape { geometry Cylinder { radius .5 height 5 } appearance DEF MANIGLIAPP Appearance { material Material { diffuseColor 0 0 0 } } } Transform { translation 0 2.5 0 children [ Shape { geometry Sphere { radius .5 } appearance USE MANIGLIAPP } ] } Transform { translation 0 -2.5 0 children [ Shape { geometry Sphere { radius .5 } appearance USE MANIGLIAPP } ] } Transform { translation 0 2.5 -1 rotation -1 0 0 1.57 children [ Shape { geometry Cylinder { height 2 radius .5 } appearance USE MANIGLIAPP } ] } Transform { translation 0 -2.5 -1 rotation -1 0 0 1.57 children [ Shape { geometry Cylinder { height 2 radius .5 } appearance USE MANIGLIAPP } ] } ] } ] } ] } ] } # frigo moviment DEF scriptFrigo Script { directOutput TRUE eventIn SFBool over eventIn SFTime touch eventOut SFBool enable eventOut SFTime closeT eventOut SFTime openT url "vrmlscript: function touch(time) { if (!enable) { openT = time; closeT = -1; } else { closeT = time; openT = -1; } enable = !enable; } " } ROUTE FRIGOSENS.touchTime TO scriptFrigo.touch ROUTE scriptFrigo.closeT TO FRIGOTIMECLOSE.startTime ROUTE scriptFrigo.openT TO FRIGOTIMEOPEN.startTime ROUTE FRIGOTIMECLOSE.fraction_changed TO INTFRIGOCLOSE.set_fraction ROUTE FRIGOTIMEOPEN.fraction_changed TO INTFRIGOOPEN.set_fraction ROUTE INTFRIGOCLOSE.value_changed TO FRIGO.set_rotation ROUTE INTFRIGOOPEN.value_changed TO FRIGO.set_rotation } #piano cucina PROTO piano_cucina [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ Shape { geometry IndexedFaceSet { coord Coordinate { point [ -65 5 -38, #A 0 -40 5 -38, #B 1 -22 5 -38, #C 2 22 5 -38, #D 3 40 5 -38, #E 4 65 5 -38, #F 5 -65 5 -22, #A' 6 -40 5 -22, #B' 7 -22 5 -22, #C' 8 22 5 -22, #D' 9 40 5 -22, #E' 10 65 5 -22, #F' 11 -40 0 -38, #B2 12 -22 0 -38, #C2 13 -40 0 -22, #B2' 14 -22 0 -22, #C2' 15 22 0 -38, #D2 16 40 0 -38, #E2 17 22 0 -22, #D2' 18 40 0 -22, #E2' 19 -65 0 -38, #A2 20 -65 0 -22, #A2' 21 65 0 -38, #F2 22 65 0 -22, #F2' 23 ] } coordIndex [ 0 1 7 6 -1 2 3 9 8 -1 4 5 11 10 -1 12 13 15 14 -1 16 17 19 18 -1 1 12 14 7 -1 2 13 15 8 -1 3 16 18 9 -1 4 17 19 10 -1 0 20 21 6 -1 5 22 23 11 -1 ] solid FALSE } appearance DEF acciaio Appearance { material Material { diffuseColor .8 .8 .8 ambientIntensity 0 specularColor .6 .6 .6 emissiveColor .3 .3 .3 shininess 1 transparency 0 } } } Transform { translation 0 2.5 -39 children [ Shape { geometry Box { size 130 5 2 } appearance USE acciaio } ] } Transform { translation 0 2.5 -21 children [ Shape { geometry Box { size 130 5 2 } appearance USE acciaio } ] } #acqua su lavello destra Transform { translation 31.1 2.5 -30 children [ Shape { geometry Box { size 18 3 15.98 } appearance Appearance { material Material { diffuseColor 0 0 1 transparency 0.15 } } } ] } ] } } #mensola PROTO mensola [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ Shape { geometry Box { size 43 1 20 } appearance Appearance { texture ImageTexture { url "wood.jpg" } } } ] } } #cappa per fumo PROTO cappa [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ Shape { geometry Box { size 44 4 20 } appearance Appearance { material Material { diffuseColor .3 .3 .3 } } } Transform { translation 0 0 10.1 children [ Shape { geometry Box { size 44 4 0.1 } appearance Appearance { texture ImageTexture { url "cappa.jpg" } } } ] } ] } } #rubinetto PROTO rubinetto [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ Transform { rotation 1 0 0 1.57 translation 0 0 -4 children [ Shape { geometry Cylinder { radius .8 height 8 } appearance DEF acciaio Appearance { material Material { diffuseColor .8 .8 .8 ambientIntensity 0 specularColor .2 .2 .2 emissiveColor .1 .1 .1 shininess 1 transparency 0 } } } ] } Shape { geometry Sphere { radius .8 } appearance USE acciaio } Transform { translation 0 -1.5 0 children [ Shape { geometry Cylinder { radius .8 height 3 } appearance USE acciaio } ] } Transform { translation -4 0 -7 rotation 1 0 0 1.57 children [ Shape { geometry Cylinder { radius 1.5 height 2 } appearance USE acciaio } Transform { translation 0 1 -.75 children [ Shape { geometry Sphere { radius .5 } appearance Appearance { material Material { diffuseColor 1 0 0 } } } ] } ] } Transform { translation 4 0 -7 rotation 1 0 0 1.57 children [ Shape { geometry Cylinder { radius 1.5 height 2 } appearance USE acciaio } Transform { translation 0 1 -.75 children [ Shape { geometry Sphere { radius .5 } appearance Appearance { material Material { diffuseColor 0 0 1 } } } ] } ] } ] } } #microwave PROTO microwave [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ Shape { geometry Box { size 15 10 10 } appearance Appearance { material Material { diffuseColor 1 1 1 } } } Transform { translation -1.25 0 5.1 children [ Shape { geometry Box { size 12.5 10 0.1 } appearance Appearance { texture ImageTexture { url "microwave_dentro.jpg" } } } ] } Transform { translation 6.25 0 5.5 children [ Shape { geometry Box { size 2.5 10 1 } appearance Appearance { texture ImageTexture { url "microwave_comandi.jpg" } } } ] } Transform { translation -7.5 0 5.5 children [ DEF MICROTIMEOPEN TimeSensor { cycleInterval 1 loop FALSE startTime -1 } DEF MICROTIMECLOSE TimeSensor { cycleInterval 1 loop FALSE startTime -1 } DEF INTMICROOPEN OrientationInterpolator { key [0, 1] keyValue [ 0 1 0 0, 0 -1 0 2.36 ] } DEF INTMICROCLOSE OrientationInterpolator { key [0, 1] keyValue [ 0 -1 0 2.36, 0 1 0 0 ] } DEF MICROSENS TouchSensor { } DEF MICRO Transform { children [ Transform { translation 6.25 0 0 children [ Shape { geometry Box { size 12.5 10 1 } appearance Appearance { texture ImageTexture { url "microwave_porta.jpg" } } } ] } ] } ] } ] } # microwave moviment DEF scriptMicro Script { directOutput TRUE eventIn SFBool over eventIn SFTime touch eventOut SFBool enable eventOut SFTime closeT eventOut SFTime openT url "vrmlscript: function touch(time) { if (!enable) { openT = time; closeT = -1; } else { closeT = time; openT = -1; } enable = !enable; } " } ROUTE MICROSENS.touchTime TO scriptMicro.touch ROUTE scriptMicro.closeT TO MICROTIMECLOSE.startTime ROUTE scriptMicro.openT TO MICROTIMEOPEN.startTime ROUTE MICROTIMECLOSE.fraction_changed TO INTMICROCLOSE.set_fraction ROUTE MICROTIMEOPEN.fraction_changed TO INTMICROOPEN.set_fraction ROUTE INTMICROCLOSE.value_changed TO MICRO.set_rotation ROUTE INTMICROOPEN.value_changed TO MICRO.set_rotation } PROTO cucina [ exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 exposedField SFRotation rotation 0 0 0 0 ] { Transform { translation IS translation scale IS scale rotation IS rotation children [ #muro nord Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 0 -40.1, #0 75 0 -40.1, #1 75 90 -40.1, #2 -75 90 -40.1, #3 ] } coordIndex [ 0 1 2 3 -1 ] solid FALSE } appearance Appearance { texture ImageTexture { url "kitchen_1.jpg" repeatS FALSE repeatT FALSE } textureTransform TextureTransform { scale 1 1.8 } } } #muro sud Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 0 60, #0 75 0 60, #1 75 90 60, #2 -75 90 60, #3 ] } coordIndex [ 0 1 2 3 -1 ] solid FALSE } appearance Appearance { texture ImageTexture { url "kitchen_1.jpg" repeatS FALSE repeatT FALSE } textureTransform TextureTransform { scale 1 1.8 } } } #quadro ale Shape { geometry IndexedFaceSet { coord Coordinate { point [ -15 50 59.9, -30 50 59.9, -30 75 59.9, -15 75 59.9 ] } coordIndex [ 0 1 2 3 -1 ] solid FALSE texCoord TextureCoordinate { point [ 0 0, 0 1, 1 1, 1 0 ] } texCoordIndex [ 0 1 2 3 -1 ] } appearance Appearance { texture ImageTexture { url "ale.jpg" repeatS FALSE repeatT FALSE } } } #quadro aemro Shape { geometry IndexedFaceSet { coord Coordinate { point [ 15 50 59.9, 30 50 59.9, 30 75 59.9, 15 75 59.9 ] } coordIndex [ 0 1 2 3 -1 ] solid FALSE texCoord TextureCoordinate { point [ 0 0, 0 1, 1 1, 1 0 ] } texCoordIndex [ 0 1 2 3 -1 ] } appearance Appearance { texture ImageTexture { url "aemro.jpg" repeatS FALSE repeatT FALSE } } } #parete ovest Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 90 -40.1, #0 -75 0 -40.1, #1 -75 90 -35, #2 -75 0 -35, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance DEF MURO Appearance { texture ImageTexture { url "kitchen_3.jpg" repeatS FALSE repeatT FALSE } } } Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 90 20, #0 -75 0 20, #1 -75 90 25, #2 -75 0 25, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance USE MURO } Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 90 55, #0 -75 0 55, #1 -75 90 60, #2 -75 0 60, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance USE MURO } Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 90 -35, #0 -75 85 -35, #1 -75 90 55, #2 -75 85 55, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance USE MURO } Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 30 -35, #0 -75 0 -35, #1 -75 30 20, #2 -75 0 20, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance USE MURO } Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 85 -35, #0 -75 30 -35, #1 -75 85 20, #2 -75 30 20, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance Appearance { material Material { diffuseColor 0 0 1 transparency .7 } } } #parete est Shape { geometry IndexedFaceSet { coord Coordinate { point [ 75 90 -65, #0 75 0 -65, #1 75 90 25, #2 75 0 25, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance USE MURO } Shape { geometry IndexedFaceSet { coord Coordinate { point [ 75 90 55, #0 75 0 55, #1 75 90 60, #2 75 0 60, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance USE MURO } Shape { geometry IndexedFaceSet { coord Coordinate { point [ 75 90 25, #0 75 90 55, #1 75 85 25, #2 75 85 55, #3 ] } coordIndex [ 0 1 3 2 -1 ] solid FALSE } appearance USE MURO } #pavimento Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 0 -40.1, #0 75 0 -40.1, #1 75 0 60, #2 -75 0 60 #3 ] } coordIndex [ 0 1 2 3 -1 ] solid FALSE } appearance Appearance { texture ImageTexture { url "kitchen_2.jpg" repeatS FALSE repeatT FALSE } } } #soffitto Shape { geometry IndexedFaceSet { coord Coordinate { point [ -75 90 -40.1, #0 75 90 -40.1, #1 75 90 60, #2 -75 90 60 #3 ] } coordIndex [ 0 1 2 3 -1 ] solid FALSE } appearance USE MURO } #lampada soffitto Transform { translation 0 87 10 children [ Shape { geometry Sphere { radius 2 } appearance Appearance { material Material { diffuseColor 1 1 0 } } } Transform { translation 0 1.5 0 children [ Shape { geometry Cylinder { radius .2 height 3 } appearance Appearance { material Material { diffuseColor 0 0 0 } } } ] } PointLight { location 0 0 0 color 1 1 1 intensity 1 ambientIntensity 0.5 location 0 0 0 radius 50 attenuation 0 1 0 } ] } #mensola mensola { translation 43.5 65 -30 } #cappa per fumo cappa { translation 0 65 -30 } # piano cucina piano_cucina { translation 0 25 0.1 } # rubinetto sinistra rubinetto { translation 31 40 -32 } # rubinetto destra rubinetto { translation -31 40 -32 } ] } } cucina { } frigo { translation -55 12.51 -30 interno "frigo_1_1.jpg" esterno "frigo_2_1.jpg" } spazzatura { translation -33 10.1 -27 } frigo { translation -11 12.51 -30 interno "frigo_1_2.jpg" esterno "frigo_2_2.jpg" } frigo { translation 11 12.51 -30 interno "frigo_1_3.jpg" esterno "frigo_2_3.jpg" } spazzatura { translation 33 10.1 -27 } frigo { translation 55 12.51 -30 interno "frigo_1_4.jpg" esterno "frigo_2_4.jpg" } microwave { translation 43.5 70 -30 } # product 1 pproduct { scale 1.75 1.75 1.75 translation 10 31.4 -29.45 mess_title "Product on the right" } # product 2 pproduct { scale 1.75 1.75 1.75 translation -10 31.4 -29.45 mess_title "Product on the left" translation_mess -4.5 3.9 0 mess_color .3 .3 1 }