#VRML V2.0 utf8 #on crée un groupe #dans lequel on trouve une sphère, un son, un touchSensor et un noeud transform Group { children [ Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Sphere { } } Sound { source DEF Click AudioClip { url "click.wav" startTime 1 loop FALSE } minFront 1000 maxFront 1000 minBack 1000 maxBack 1000 } # dans le noeud Transform, on ajoute un cube Transform { translation 4 0 0 children Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Box { size 2 2 2} } } DEF TS TouchSensor { } ] # tant que le pointeur de souris est sur un des objets géré par le TouchSensor, # le son est joué en boucle ! ROUTE TS.isOver TO Click.loop }