#VRML V2.0 utf8 #sapin.wrl Sebastien Marnier 04/98 Viewpoint { position 0 1 4 } PROTO Clignote [ #on defini un proto appele "clignote" field MFColor couleurs 0 0 0 #on defini le parametre couleurs field SFTime cycle 1 #on defini parametre cycle ] { DEF M Material {} #le premier noeud rencontre defini le proto DEF C ColorInterpolator { #un interpolator pour changer les couleurs key [ 0 0.5 1 ] keyValue IS couleurs #on attribut le parametre couleurs } DEF T TimeSensor { #une horloge pour l'animation cycleInterval IS cycle #on attribut le parametre cycle enabled TRUE loop TRUE } ROUTE T.fraction_changed TO C.set_fraction #une fraction de temps vers l'interpolator ROUTE C.value_changed TO M.diffuseColor #la couleur calculee vers la boule } #fin du proto Transform { #tronc du sapin translation 0 0.2 0 children Shape { appearance Appearance { material Material { diffuseColor 0.7 0 0 } } geometry Cylinder { radius 0.1 height 0.4 } } } Transform { #sapin translation 0 0.9 0 children Shape { appearance Appearance { material Material { diffuseColor 0 1 0 } } geometry Cone { bottomRadius 0.7 height 1 } } } Transform { #une boule translation 0 1.4 0 children Shape { appearance Appearance { material Clignote { #on utilise clignote a la place de Material couleurs [ 1 0 0, 0 0 1 ] #on defini le parametre couleurs rouge - bleu cycle 3.0 #on defini la parametre cycle 3 secondes } } geometry Sphere { radius 0.1 } } } Transform { #boule 2 translation 0.1 1 0.3 children Shape { appearance Appearance { material Clignote { couleurs [ 0 0 1,0 1 0] cycle 2.0 } } geometry Sphere { radius 0.1 } } } Transform { #boule 3 translation -0.55 0.7 0 children Shape { appearance Appearance { material Clignote { couleurs [ 1 0 0,1 1 0] cycle 4.0 } } geometry Sphere { radius 0.1 } } } Transform { #boule 4 translation 0.5 0.6 0.4 children Shape { appearance Appearance { material Clignote { couleurs [ 0 0.5 1,0 1 0.5] cycle 1.0 } } geometry Sphere { radius 0.1 } } }