#VRML V2.0 utf8 WorldInfo { info [ "2001/10/8 Ver1.1 by GoGoGo" "http://www1.plala.or.jp/Studio_GoGoGo/" ] title "Rainbow Text 2" } Viewpoint { position 0 0 9 } DEF textGroup Group {} DEF Timer TimeSensor {loop TRUE cycleInterval 0.2} DEF SC Script { eventIn SFTime cycleTime eventOut MFNode addChildren eventOut MFNode removeChildren field SFInt32 count 0 field SFNode textGroup USE textGroup field SFString str1 " Transform { translation " field SFString str2 "0" field SFString str3 " 0 0 children [ Shape { appearance Appearance { material DEF m Material { diffuseColor 0 0 0 } } geometry Text { string \"" field SFString str4 "" field SFString str5 "\" fontStyle FontStyle {justify \"MIDDLE\" style \"ITALIC\"} } } ] } DEF VS VisibilitySensor {} DEF colorTimer TimeSensor {cycleInterval 5} DEF PI PositionInterpolator { key [0 0.1 0.85 1] keyValue [0 0 0, 0 1 1, 0.833 1 1, 0.833 0 0] } DEF colorSC Script { eventIn SFBool VSisActive eventIn SFVec3f valueIn eventOut SFTime startTime eventOut SFTime stopTime eventOut SFColor colorOut url \"javascript: function VSisActive(isActive,time) { if (isActive) startTime=time; } function valueIn(value) { colorOut.setHSV(value.x,value.y,value.z); }\" } ROUTE VS.isActive TO colorSC.VSisActive ROUTE colorTimer.fraction_changed TO PI.set_fraction ROUTE PI.value_changed TO colorSC.valueIn ROUTE colorSC.startTime TO colorTimer.startTime ROUTE colorSC.colorOut TO m.set_diffuseColor " url "javascript: function cycleTime(value) { count++; if (count==1) {str2='-3.34'; str4='*';} if (count==2) return; if (count==3) {str2='-2.65'; str4='S';} if (count==4) {str2='-2.28'; str4='t';} if (count==5) {str2='-1.94'; str4='u';} if (count==6) {str2='-1.49'; str4='d';} if (count==7) {str2='-1.15'; str4='i';} if (count==8) {str2='-0.81'; str4='o';} if (count==9) return; if (count==10) {str2='-0.04'; str4='G';} if (count==11) {str2='0.50'; str4='o';} if (count==12) {str2='1.04'; str4='G';} if (count==13) {str2='1.59'; str4='o';} if (count==14) {str2='2.13'; str4='G';} if (count==15) {str2='2.67'; str4='o';} if (count==16) return; if (count==17) {str2='3.34'; str4='*';} if (count>17 && count<40) return; if (count==40) {removeChildren=textGroup.children; count=0; return;} addChildren=Browser.createVrmlFromString(str1+str2+str3+str4+str5); }" } ROUTE Timer.cycleTime TO SC.cycleTime ROUTE SC.addChildren TO textGroup.addChildren ROUTE SC.removeChildren TO textGroup.removeChildren