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-NURBSdemo.vr

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


  
  
  NavigationInfo{ type "EXAMINE" }
  Background{ skyColor 1 1 1}
  
  PROTO NURBSdemo[
   field MFVec3f cPoint [-1 -1 0,1 -1 0,  -1 1 0,0 0 1.41]
   field SFInt32 uDim 2
   field SFInt32 vDim 2 ]{
  Transform{ scale 2 2 2 children[
   Shape{ appearance Appearance{ material Material{ diffuseColor 1 1 1 transparency .2}}
    geometry NurbsSurface{ 
     uDimension IS uDim  vDimension IS vDim
     controlPoint IS cPoint 
     uOrder 2  vOrder 2
     uKnot[0,0,1,1]  vKnot[0,0,1,1]
  #   uTessellation 32   vTessellation 32
     solid FALSE }}
   Shape{ appearance Appearance{ material Material{ emissiveColor 0 0 1} }
    geometry DEF grid IndexedLineSet{ coord Coordinate{ point IS cPoint} } }
  ]}
  
  DEF SCR Script{
   field SFInt32 uDim IS uDim
   field SFInt32 vDim IS vDim
   field SFNode grid USE grid
   directOutput TRUE
  url ["javascript:
  
  function initialize() { 
   c = new MFInt32();
   t= t1 =0;
   for (i= 0; i< vDim; i++){
    for (j= 0; j< uDim; j++) c[t++] = t1++;
    c[t++] = -1;}
   for (i= 0; i< uDim; i++){
    t1= i;
    for (j= 0; j< vDim; j++){
     c[t++] = t1;  t1 += uDim;}
    c[t++] = -1;}
   grid.set_coordIndex = c;
  }
  "]}
  
  }
  NURBSdemo{}


(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.