#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 { } } Sound { source DEF Click AudioClip { url "click.wav" stopTime 1 } 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} } } # Dans le groupe on met en TouchSensor # Le Cube est un fils un noeud Transform # Qui est le fils du noeud group # Le cube hérite donc des propriété du TouchSensor DEF TS TouchSensor { } ] ROUTE TS.touchTime TO Click.startTime }