#VRML V2.0 utf8 WorldInfo { info "2000/9/20 by GoGoGo, http://www1.plala.or.jp/Studio_GoGoGo/" title "Texture On/Off 3/4" } NavigationInfo {type "EXAMINE"} Viewpoint {} #Box DEF TS TouchSensor {} Shape { appearance DEF apr Appearance { material Material {} } geometry Box {} } #Script DEF SC Script { eventIn SFTime touchTime eventOut SFNode ImageTexture field SFBool texOn FALSE field SFNode iTex1 ImageTexture {url "sign.gif"} field SFNode iTex2 ImageTexture {} url "javascript: function touchTime(value){ if(!texOn){ texOn=TRUE; ImageTexture=iTex1; } else { texOn=FALSE; ImageTexture=iTex2; } }" } ROUTE TS.touchTime TO SC.touchTime ROUTE SC.ImageTexture TO apr.set_texture