#VRML V2.0 utf8 #le viewpoint de départ Viewpoint { position 0 1.8 30 fieldOfView 0.78 description "sur la route" } #le viewpoint dans la maison Viewpoint { position 0 2 0 fieldOfView 0.78 description "dans la maison" } #on fait un beau ciel bleu Background { skyAngle [0.8 1.4 1.6] skyColor [0.2 0.2 0.6, 0.2 0.3 0.7, 0.5 0.5 0.8, 0.6 0.7 0.8] } #et on oublie surtout pas le soleil PointLight { intensity 1 color 1 1 1 location 0 400 0 radius 500 } #on déclare tous les prototype au début du programme #afin de pouvoir les utiliser dans la suite # Proto qui permet de créer des plaques PROTO SOL [field SFVec3f Dimension 400 1 400 field SFColor Couleur 1 1 1 field SFVec3f Position 0 0 0] {Transform { children [ Shape {geometry Box { size IS Dimension} appearance Appearance { material Material { diffuseColor IS Couleur} }}] translation IS Position}} #proto qui permet de creer une baricade #on utilise le proto sol pour faire les planches en bois PROTO Baricade[field SFColor Couleur 0.35 0.16 0.12 field SFVec3f Position 0 0 0] {Transform {children [ SOL{Dimension 0.2 1.5 0.05 Position -2.5 0.75 0 Couleur IS Couleur } SOL{Dimension 0.2 1.5 0.05 Position 2.5 0.75 0 Couleur IS Couleur } SOL{Dimension 5.2 0.2 0.05 Position 0 1.4 0.05 Couleur IS Couleur } SOL{Dimension 5.2 0.2 0.05 Position 0 0.7 0.05 Couleur IS Couleur } ]translation IS Position }} #proto pour la création de 3 arbres différents PROTO Arbre1 [ field SFVec3f Position 0 0 0 ] {Group { children [Transform {children [Billboard { children [Shape {geometry Box {size 4 4 0} appearance Appearance {texture ImageTexture {url "textures/arbre1.gif"}} }]}]translation IS Position} Transform{children[Shape{ geometry Box {size 4 4 0} appearance Appearance {texture ImageTexture {url "textures/arbre1.gif"}} } ] rotation 0 1 0 1.57 translation IS Position } ] } } PROTO Arbre2 [ field SFVec3f Position 0 0 0 ] {Group { children[Transform{children [Billboard {children [Shape {geometry Box {size 4 4 0} appearance Appearance {texture ImageTexture {url "textures/arbre5.gif"}} }]}]translation IS Position} Transform{children [ Shape { geometry Box {size 4 4 0} appearance Appearance{texture ImageTexture {url "textures/arbre5.gif"}} } ] rotation 0 1 0 1.57 translation IS Position } ] } } PROTO Arbre3 [ field SFVec3f Position 0 0 0 ] {Group { children [Transform {children [Billboard {children [ Shape {geometry Box {size 4 4 0} appearance Appearance {texture ImageTexture {url "textures/arbre4.gif"}} }]}]translation IS Position } Transform{children [ Shape { geometry Box {size 4 4 0} appearance Appearance {texture ImageTexture {url "textures/arbre4.gif"}} } ] rotation 0 1 0 1.57 translation IS Position } ] } } #animation qui va créer le déplacement #le principe est qu'en fait c'est le terrain qui se déplace et non pas nous #pour cela on définit un objet auquel on attribuera un déplacement #cet objet sera en fait toute la scène DEF Animation Transform {children [ #grande plate forme verte Transform { children [ Shape {geometry Box { size 300 0.5 300} appearance Appearance { texture ImageTexture {url "textures/grass2.jpg" }textureTransform TextureTransform {scale 300 300} }}] } #sol de la maison Transform { children [ Shape {geometry Box { size 10.5 0.6 10.5} appearance Appearance { texture ImageTexture {url "textures/parquet.jpg" }textureTransform TextureTransform {scale 4 4} }}] } #sol de l'allée Transform { children [ Shape {geometry Box { size 1 0.6 25} appearance Appearance { texture ImageTexture {url "textures/gravier01.jpg" }textureTransform TextureTransform {scale 1 732} }}]translation 0 0 17.8 } #on dessine des jolies arbres un peu partout Arbre1 {Position -10 2.4 -10} Arbre2 {Position 10 2.4 -10} Arbre3 {Position 30 2.4 -25} Arbre1 {Position 20 2.4 -32} Arbre1 {Position -25 2.4 -37} Arbre1 {Position 22 2.4 -41} Arbre1 {Position -23 2.4 -17} Arbre3 {Position -15 2.4 -12} Arbre3 {Position 0 2.4 -18} Arbre3 {Position -5 2.4 -22} Arbre2 {Position -22 2.4 -27} Arbre2 {Position 2 2.4 -14} Arbre2 {Position 6 2.4 -22} Arbre1 {Position 5 2.4 -17} Arbre3 {Position -10 2.4 -7} Arbre2 {Position 1 2.4 -15} Arbre1 {Position 10 2.4 -17} Arbre2 {Position -6 2.4 -22} Arbre1 {Position -5 2.4 -11} Arbre2 {Position 7 2.4 -10} Arbre1 {Position 13 2.4 -1} #la belle statue à l'interieur de la maison sur son socle DEF Statue Transform { translation 0 1.5 0 rotation 1 0 0 -0.6 scale 0.5 0.5 0.5 children [Inline {url "pegasus2.WRL"}]} Transform {children [Shape {geometry Box {size 1.5 1.75 1.5} appearance Appearance { texture ImageTexture {url "textures/marb030.jpg" } textureTransform TextureTransform {scale 4 4}}}] translation 0 0 0.5} #ecrire "entrez" en dessous le socle puis faire un lien vers la page d'accueil Anchor { url "accueil.html" description "Cliquez ici pour aller sur le site capcheval" parameter "target=newpage" children [ Transform {children [Shape {geometry Box {size 1.5 1.75 0.01} appearance Appearance { texture ImageTexture {url "textures/panneau.jpg" } textureTransform TextureTransform {scale 1 3}}}] translation 0 0 1.3} ] } #baricade de part et d'autre de la maison Baricade {Position -8.5 0 3} Baricade {Position -13.5 0 3} Baricade {Position 8.5 0 3} Baricade {Position 13.5 0 3} Baricade {Position -18.5 0 3} Baricade {Position 18.5 0 3} Baricade {Position 28.5 0 3} Baricade {Position -23.5 0 3} Baricade {Position 23.5 0 3} Baricade {Position -28.5 0 3} Baricade {Position 38.5 0 3} Baricade {Position 33.5 0 3} Baricade {Position -38.5 0 3} Baricade {Position -33.5 0 3} #on met un cheval derrière la baricade DEF Cheval Transform { translation 10 2.7 0 rotation 0 0 0 0 scale 1.5 1.5 1.5 children [Inline {url "cheval_2.WRL"}]} #on en met un autre de l'autre coté DEF Cheval2 Transform { translation -10 2.7 0 rotation 0 1 0 1.78 scale 1.5 1.5 1.5 children [Inline {url "cheval_2.WRL"}]} #on fait les 2 cavaliers aux cotés de la porte DEF Cavalier Transform { translation -2 1.5 25 rotation 0 1 0 1.78 scale 0.5 0.5 0.5 children [Inline {url "cavallo.WRL"}]} DEF Cavalier2 Transform { translation 2 1.5 25 rotation 0 1 0 1.78 scale 0.5 0.5 0.5 children [Inline {url "cavallo.WRL"}]} #les 2 cubes en dessous les cavaliers Transform {children [Shape {geometry Box {size 1.5 1.5 1.5} appearance Appearance {texture ImageTexture {url "textures/marb030.jpg"} textureTransform TextureTransform { scale 4 4 } } } ] translation -2 0 25} Transform {children [Shape {geometry Box {size 1.5 1.5 1.5} appearance Appearance {texture ImageTexture {url "textures/marb030.jpg"} textureTransform TextureTransform { scale 4 4 } } }] translation 2 0 25} #Création de la maison Transform{children[ Shape {geometry Extrusion {crossSection [-0.5 -5.5, -0.5 -5.3, -5.3 -5.3, -5.3 5.3, 5.3 5.3, 5.3 -5.3, 0.5 -5.3, 0.5 -5.5, 5.5 -5.5, 5.5 5.5, -5.5 5.5, -5.5 -5.5, -0.5 -5.5] spine[0 0 0, 0 3 0] convex TRUE solid FALSE} appearance Appearance{texture ImageTexture {url "textures/mur2.jpg"} textureTransform TextureTransform {scale 16 1.2} }}]rotation 0 1 0 3.14} Shape { geometry IndexedFaceSet {coord Coordinate {point [-6 3 6, 6 3 6, 6 3 -6, -6 3 -6, -6 3.2 6, 6 3.2 6, 6 3.2 -6, -6 3.2 -6, 0 6 0] } coordIndex [0,1,2,3,-1, 0,1,5,4,-1, 2,3,7,6,-1, 1,2,6,5,-1, 3,0,4,7,-1, 0,8,1,-1, 3,8,0,-1, 1,8,2,-1, 2,8,3,-1] convex FALSE solid FALSE } appearance Appearance {texture ImageTexture {url "textures/tuile2.jpg"} textureTransform TextureTransform { scale 11 8 } } } Transform { children [ Shape {geometry Box { size 10.5 0.1 10.5} appearance Appearance { material Material { diffuseColor 1 1 1 }}}] translation 0 3 0 } #les tableaux sur les murs à l'intérieur de la maison Transform { children [ Shape {geometry Box { size 1.5 1.5 0.05} appearance Appearance { texture ImageTexture {url "textures/horseBleu.png" }textureTransform TextureTransform {scale 1 1} }}] translation 3.2 1.9 5.5 } Transform { children [ Shape {geometry Box { size 1.5 1.5 0.05} appearance Appearance { texture ImageTexture {url "textures/horseVert.png" }textureTransform TextureTransform {scale 1 1} }}] translation -3.2 1.9 5.5 } Transform { children [ Shape {geometry Box { size 2 1.5 0.05} appearance Appearance { texture ImageTexture {url "textures/cheval1.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation 3.2 1.9 5.2 } Transform { children [ Shape {geometry Box { size 1.8 1.3 0.05} appearance Appearance { texture ImageTexture {url "textures/chevaux-neige.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation -3.2 1.7 5.2 } Transform { children [ Shape {geometry Box { size 0.05 1.3 1.1} appearance Appearance { texture ImageTexture {url "textures/cheval5.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation 5.2 2 -2.1 } Transform { children [ Shape {geometry Box { size 0.05 2 2} appearance Appearance { texture ImageTexture {url "textures/cheval2.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation 5.2 1.6 2.5 } Transform { children [ Shape {geometry Box { size 0.05 1.7 1.7} appearance Appearance { texture ImageTexture {url "textures/cheval6.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation -5.2 1.7 -2.1 } Transform { children [ Shape {geometry Box { size 0.05 1.5 1.6} appearance Appearance { texture ImageTexture {url "textures/cheval4.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation -5.2 1.4 2.5 } Transform { children [ Shape {geometry Box { size 2 1.5 0.05} appearance Appearance { texture ImageTexture {url "textures/cheval1.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation 3.2 1.9 -5.2 } Transform { children [ Shape {geometry Box { size 1.8 1.3 0.05} appearance Appearance { texture ImageTexture {url "textures/chevaux-neige.jpg" }textureTransform TextureTransform {scale 1 1} }}] translation -3.2 1.7 -5.2 } #definition de la porte + animation de la porte #on définit une animation à la porte de façon #a ce qu'elle s'ouvre lorsqu'on s'approche d'elle DEF PORTE Transform { children [Shape { geometry Box { size 1 2.95 0.1 } appearance Appearance {texture ImageTexture {url "textures/porte4_tets.jpg"} textureTransform TextureTransform {scale 1 1}} } #la porte s'ouvre quand on arrive a coté DEF CLIC ProximitySensor {size 25 25 25} DEF TEMPS TimeSensor {cycleInterval 2 loop FALSE } DEF OUVRE OrientationInterpolator {key [0 0.5 1] keyValue [0 1 0 0, 0 1 0 0.78, 0 1 0 1.57] } ]translation 0 1.5 5.45 center 0.5 0 0 ROUTE CLIC.enterTime TO TEMPS.startTime ROUTE TEMPS.fraction_changed TO OUVRE.set_fraction ROUTE OUVRE.value_changed TO PORTE.rotation } #on définit l'animation de la scène #elle doit se déclencher automatiquement DEF Depart ProximitySensor {size 200 200 200} DEF Temps3 TimeSensor {cycleInterval 32 loop FALSE startTime 0 stopTime 0} #on défini une ligne de temps où à chaque moment #on effectue une animation ou non. #animation pour la rotation de la caméra #le 4ème paramètre correspond à l'angle souhaité #les 3 premiers ont X, Y ou Z #on met pour dire qu'on souhaite faire une rotation #à partir de cet axe DEF Rotat OrientationInterpolator {key [0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1] keyValue [0 1 0 1.78, 0 0 0 0, 0 0 0 0, 0 0 0 0, 0 0 0 0, 0 0 0 0, 0 0 0 0, 0 0 0 0, 0 1 0 1.78, 0 1 0 3.14, 0 1 0 5, 0 1 0 6.28 ]} #animation pour la translation de la caméra #les 3 paramètres correspondent à X, Y ou Z #on met la valeur de déplacement souhaité à l'axe souhaité #et au moment souhaité DEF Translat PositionInterpolator { key [0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1] keyValue [0 -15 -30, 0 -7 -10, 0 -0.9 10, 0 -0.9 20, 0 -0.9 20, 0 -0.9 25, 0 -0.9 25, 0 -0.9 25, 0 -0.9 25, 0 -0.9 25, 0 -0.9 25, 0 -0.9 25, 0 -0.2 22, 0 1 27 ]} ] #creation de l'animation ROUTE Depart.enterTime TO Temps3.startTime ROUTE Temps3.fraction_changed TO Translat.set_fraction ROUTE Translat.value_changed TO Animation.translation ROUTE Temps3.fraction_changed TO Rotat.set_fraction ROUTE Rotat.value_changed TO Animation.rotation }