#VRML V2.0 utf8 # On supprime l'éclairage depuis l'avatar, efin d'éviter toute perturbation NavigationInfo { headlight FALSE } Transform { rotation 1.5 2.5 1.5 3.142 scale 2 2 2 children Shape { # on crée un cone pour tester la lumière appearance Appearance { material Material { diffuseColor 0 0 1 # Un cone de couleur bleue } } geometry Cone { } } } DEF Lumiere Transform { # le noeud Transform permettra de faire tourner la lumière. children Transform { translation 0 0 4.5 children [ Shape { # on crée une sphere qui représentera la lumière appearance Appearance { material Material { emissiveColor 1 1 1 } } geometry Sphere { radius .5} } # Et voici la lumière # Vous remarquerez qu'elle est aussi appliquée à la sphere # Qui pourtant n'appartient pas au groupe du PointLight # En effet, le PointLight s'applique à tous les objets PointLight { color 1 1 1 } ] } } DEF LightMvt Script { eventIn SFFloat set_move eventOut SFRotation rot_changed field SFRotation xrots 0 1 0 4.14 url "vrmlscript: function set_move(value){ xrots.angle = xrots.angle + .015; if (xrots.angle > 3.14159*2) xrots.angle = xrots.angle - 3.14159*2; rot_changed = xrots; } " } DEF Timer TimeSensor { stopTime -1 cycleInterval 400 loop TRUE } ROUTE Timer.fraction_changed TO LightMvt.set_move ROUTE LightMvt.rot_changed TO Lumiere.set_rotation