#VRML V2.0 utf8 #on crée un groupe #dans lequel on trouve une sphère, un son, un touch Sensor et un noeud transform Group { children [ Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Sphere { } } # dans le noeud Transform, on ajoute un cube avec une rotation Transform { translation 4 0 0 rotation 1 2 0 1 children Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Box { size 2 2 2} } } # Dans le groupe on met le TouchSensor DEF TS TouchSensor { } ] } #On place la boule bleue en dehors du groupe Transform { # Le noeud transform pour controler la position de la boule bleue children DEF boulebleue Transform { translation 0 0 0 children [ Shape { # la petite boule bleue appearance Appearance { material Material { diffuseColor 0 0 1 } } geometry Sphere { radius 0.2 } } ] } } # On copie le hit_point changed sur la position de la boule # On plaqce ainsi la boule à l'intersection du pointeur et le l'objet ROUTE TS.hitPoint_changed TO boulebleue.translation