media @ VU
[] readme course(s) preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthought(s) appendix reference(s) example(s) resource(s) _

talk show tell print

vrml-math-GreatIntII.vr

vrml-math-GreatIntII.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  
  
  NavigationInfo{ type "EXAMINE" }
  Viewpoint{ description "start"}
  Background{ skyColor .75 0 0}
  
  DEF ROOT Transform{ rotation 1 0 .1 -.55 scale 3 3 3
   children[ DEF Touch TouchSensor{}]}
  
  DEF Polyhedron Script {
    eventIn SFBool iterate
    eventOut MFNode new_f
    field SFNode ROOT USE ROOT
    directOutput TRUE
  url ["javascript:
  function initialize(){ 
    iter = 0;
    str_f =
  'DEF Top Transform{ children[ '+
  'DEF t2 Shape{ appearance Appearance{ material Material{ diffuseColor 1 1 0}} '+
  'geometry IndexedFaceSet{ coord Coordinate{ point[ '+
  '0 .191 1,.2245 .191 .309,-.2245 .191 .309,0 -.191 .382,0 .427 0,0 .809 .618]} '+
  'coordIndex[0 1 2 -1 0 2 3 -1 0 3 1 -1 2 1 5 -1 1 4 5 -1 2 5 4]}} '+
  'Transform{ rotation 0 1 0 1.257 children USE t2} '+
  'Transform{ rotation 0 1 0 2.51 children USE t2} '+
  'Transform{ rotation 0 1 0 -1.257 children USE t2} '+
  'Transform{ rotation 0 1 0 -2.51 children USE t2} ]} '+
  'Transform{ rotation 1 0 0 3.1416 children USE Top}';
    new_f = Browser.createVrmlFromString( str_f );
    ROOT.addChildren = new_f;
  }
  
  function iterate(value){
    if (value) {
  //    ROOT.removeChildren = new_f;
      iter++;
      str_f =
  'DEF r'+iter+' Transform{ children[ '+
  'Transform{ translation 0 .118 .618 children '+
  'DEF s'+iter+' Transform{ scale .382 .382 .382 children[ '+
  str_f +
  ']}} Transform{ translation 0 .5 .382 children USE s'+iter+'} '+
  'Transform{ translation 0 -.118 -.618 children USE s'+iter+'} '+
  'Transform{ translation 0 -.5 -.382 children USE s'+iter+'} ]}'+
  'Transform{ rotation 0 1 0 1.257 children USE r'+iter+'} '+
  'Transform{ rotation 0 1 0 2.51 children USE r'+iter+'} '+
  'Transform{ rotation 0 1 0 -1.257 children USE r'+iter+'} '+
  'Transform{ rotation 0 1 0 -2.51 children USE r'+iter+'} ';
      new_f = Browser.createVrmlFromString( str_f );
      ROOT.addChildren = new_f;
     }
  }
  "]}
  
  ROUTE Touch.isActive TO Polyhedron.iterate
  


(C) A. Eliëns 2/9/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.