#VRML V2.0 utf8 #*** GENERALITES ************************************************** NavigationInfo { type ["WALK"] avatarSize [.1 1.6 2] headlight FALSE speed 5 } Background{ skyAngle [ 1.1 1.57 ] skyColor [ .3 .3 1 .4 .4 1 .7 .7 .9 ] } DirectionalLight { direction 0 -.5 -1 intensity 1 } DirectionalLight { direction -1 -.5 .5 intensity .9 } DirectionalLight { direction 1 -.5 .5 intensity .8 } #*** MONDE ******************************************************** Viewpoint { position 50 1.6 150 description "Entry" } Viewpoint { position 50 200 50 orientation 1 0 0 -1.54 description "Plan" } Shape { appearance Appearance { material Material { diffuseColor 0 .6 .6 transparency .1 } } geometry Box { size 1000 0.01 1000 } } DEF ROOT Transform {} #*** SCRIPT ******************************************************* Script { field SFNode ROOT USE ROOT url "javascript: function R(){ return Math.random(); } function initialize(){ for(i=0;i<30;i++){ string= 'Transform { '+ ' translation '+100*R()+' 0 '+100*R()+' '+ ' children [ '+ ' Shape { '+ ' appearance Appearance { '+ ' material Material { '+ ' diffuseColor '+R()+' '+R()+' '+R()+' '+ ' } '+ ' } '+ ' geometry Box { '+ ' size '+20*R()+' '+40*R()+' '+20*R()+' '+ ' } '+ ' } '+ ' ] '+ '} '; newNode = Browser.createVrmlFromString(string); ROOT.children[i]=newNode[0]; } for(i=30;i<130;i++){ string= 'Transform { '+ ' translation '+100*R()+' '+30*R()+' '+100*R()+' '+ ' children [ '+ ' Shape { '+ ' appearance Appearance { '+ ' material Material { '+ ' diffuseColor '+R()+' '+R()+' '+R()+' '+ ' } '+ ' } '+ ' geometry Sphere { '+ ' radius '+0.5*R()+' '+ ' } '+ ' } '+ ' ] '+ '} '; newNode = Browser.createVrmlFromString(string); ROOT.children[i]=newNode[0]; } } " }