#VRML V2.0 utf8 #visualiseur d'objets virtuels Sebastien Marnier 02/98 #les noms et echelles de chaque objets s'inscrivent dans les tableau1 et 2 #du script "select". #l'url des objets se trouve dans le noeud switch "affiche". Group { children [ Viewpoint { position 0 1.6 4 } Transform { #plateform et triD translation 0 0.1 -11 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0 0 } } geometry Box { size 19 0.2 19 } } ] }, Transform { #holopied x 4 translation -7 0.2 -4 rotation 0 1 0 3.93 children [ DEF holopied Shape { appearance Appearance { material Material { diffuseColor 0.8 0 0 } } geometry IndexedFaceSet { coord Coordinate { point [ 0 0 1.5,0 0 -1.5,1 0 -1.5,1 0 1.5, 1 2.5 1,1 2.5 -1,2 2.5 -1,2 2.5 1, 0 4 1,0 4 -1,0.5 4.5 -1,0.5 4.5 1, -3 5 0 ] } coordIndex [ 0,3,7,4,-1,3,2,6,7,-1,2,1,5,6,-1,1,0,4,5,-1, 4,7,11,8,-1,7,6,10,11,-1,6,5,9,10,-1,5,4,8,9,-1, 8,11,12,-1,11,10,12,-1,10,9,12,-1,9,8,12,-1 ] } } DEF tdboule Transform { translation -3 5 0 rotation 0 0 1 1.57 children [ Shape { appearance Appearance { material Material { diffuseColor 0.5 0.5 0.6 specularColor 0.9 0.9 0.9 shininess 0.9 } } geometry Sphere { radius 1 } } Transform { translation -4.5 2 -5 rotation 1 0 0 5.50 children [ Shape { appearance Appearance { material Material { diffuseColor 0.5 0.4 0 specularColor 0.95 0.73 0 shininess 0.93 } } geometry Cylinder { radius 0.1 height 14 } } ] } ] } ] }, Transform { translation 7 0.2 -4 rotation 0 1 0 5.50 children [ USE tdboule USE holopied ] } Transform { translation 7 0.2 -18 rotation 0 1 0 0.78 children [ USE tdboule USE holopied ] } Transform { translation -7 0.2 -18 rotation 0 1 0 2.36 children [ USE tdboule USE holopied ] } Transform { #pupitre de commande translation 0 1 0 scale 1 0.2 1 children [ Shape { appearance DEF bleu Appearance { material Material { diffuseColor 0 0 1 } } geometry Sphere { radius 1 } } ] } Transform { #pied translation 0 0.5 0 children [ Shape { appearance USE bleu geometry Cone { bottomRadius 0.3 height 1 } } ] }, Transform { #ecran translation -1 1.5 -0.4 children [ Shape { appearance USE bleu geometry Box { size 1.5 0.2 0.2 } } ] }, Transform { #support boutons translation 1 1.5 -0.4 children [ Shape { appearance USE bleu geometry Box { size 1.5 0.2 0.2 } } ] }, Transform { #forme pupitre translation 0 1.1 -0.4 scale 2 1 1 children [ Shape { appearance USE bleu geometry Sphere { radius 0.4 } } ] }, Transform { #boutons translation 1 1.5 -0.28 children [ Shape { appearance Appearance { texture ImageTexture { url ["bouton.gif"] } } geometry Box { size 1.35 0.12 0.01 } } DEF plaque TouchSensor {} #on utilise l'evenement hitTextCoord #d'un TouchSensor pour creer une image ] #reactive } Transform { #sphere de rotation translation 0 1.2 0.4 children [ Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Sphere { radius 0.2 } } DEF boule SphereSensor {} #on associe un SphereSensor a la boule qu'on ] #utilise pour pivoter le groupe "objet" contenant }, #le groupe switch et ses divers objets Transform { #noms d'objets translation -1.6 1.45 -0.28 scale 0.2 0.2 0.2 children [ Shape { geometry DEF ecran Text { } } ] }, DEF objet Transform { translation 0 4 -11 children [ DEF affiche Switch { #le groupe switch affiche une forme suivant whichChoice 0 #la valeur de wichChoice choice [ #debut des differents noeud Transform { #forme 0 translation -8 0 0 children [ Shape { geometry Text { string ["Selectionnez un objet avec les petits boutons", "Faites le pivoter avec la sphere."] } } ] } Shape { #forme 1 appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Box {} } Shape { #forme 2 appearance Appearance { material Material { diffuseColor 0 1 0 } } geometry Sphere {} } Shape { #forme 3 appearance Appearance { material Material { diffuseColor 0 0 1 } } geometry Cone {} } Inline { #forme 4 url ["palmier.wrl"] #on utilise le fichier "palmier.wrl" } Inline { #forme 5 url ["antenne.wrl"] } Inline { #forme 6 url ["papillon.wrl"] } Inline { #forme 7 url ["bill9000.wrl"] } Inline { #forme 8 url ["siege.wrl"] } Inline { #forme 9 url ["lit.wrl"] } ] } ] }, DEF select Script { field SFNode coordo USE plaque directOutput TRUE field MFString tableau1 ["Aide","Box","sphere","cone","palmier","Antenne","papillon","bill9000","siege","lit"] field MFVec3f tableau2 [0.8 0.8 0.8,2 2 2,2 2 2,2 2 2,0.3 0.3 0.3,1 1 1,6 6 6,5 5 5,4 4 4,2 2 2] eventIn SFTime temps eventIn SFVec2f audessus eventOut SFVec3f echelle eventOut SFInt32 choix eventOut MFString mot url [ "javascript: function temps(){ choix=Math.floor(coordo.hitTexCoord_changed[0]*10); echelle=tableau2[choix]; } function audessus(val){ mot[0]=tableau1[Math.floor(val[0]*10)]; } " ] }, ] } ROUTE boule.rotation_changed TO objet.set_rotation ROUTE plaque.hitTexCoord_changed TO select.audessus ROUTE select.mot TO ecran.set_string ROUTE plaque.touchTime TO select.temps ROUTE select.echelle TO objet.set_scale ROUTE select.choix TO affiche.whichChoice