media @ VU
[] readme course preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthoughts appendix references examples resources _

talk show tell print

web3d-x-nurb-ip.vr

web3d-x-nurb-ip.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]

Web3D/VR

nurb interpolation

externnproto


  
  EXTERNPROTO NurbsPositionInterpolator [
    eventIn      SFFloat  set_fraction
    eventIn      MFFloat  set_knot
    eventIn      MFFloat  set_order
    eventIn      MFFloat  set_keyValue
    exposedField SFBool   fractionAbsolute 
    exposedField MFFloat  keyWeight        
    field MFFloat  knot                                             
    field SFInt32  order                                          
    field MFVec3f  keyValue                                 
    eventOut     SFVec3f  value_changed 
  ]
  [
          "urn:inet:blaxxun.com:node:NurbsPositionInterpolator",
          "nurbs.wrl#NurbsPositionInterpolator"  # for local testing
          "<a href=http://www.blaxxun.co>/vrml/protos/nurbs.wrl#NurbsPositionInterpolator"
  ]
  
  

extern proto curve


  
  EXTERNPROTO NurbsCurve [
    field             MFFloat   knot             
    field             SFInt32   order                
  
    exposedField      MFVec3f   controlPoint     
    exposedField      MFFloat   weight          
    exposedField      SFInt32  tessellation      
  ] 
  [
          "urn:inet:blaxxun.com:node:NurbsCurve",
          "nurbs.wrl#NurbsCurve"  # for local testing
          "<a href=http://www.blaxxun.co>/vrml/protos/nurbs.wrl#NurbsCurve"
  ]
  
  

transform root


  
  Transform {
  children [
  Shape {
                  appearance Appearance {
                          material Material {
                                  diffuseColor 0 1 0
                              ambientIntensity 1
                                  emissiveColor 1 0 0
                          }
                  }
                  geometry NurbsCurve {
                          knot [0, 0, 0, .2, .4, .6, .8, 1, 1] 
                          tessellation 50
                          controlPoint [0 0 0, 1 1 0, 0 2 0, 2 3 0, -1 4 0, 5 5 0]
                  }
  }
  
  

interpolator


  
  DEF NurbsInt NurbsPositionInterpolator {
  knot[0, 0, 0, .2, .4, .6, .8, 1, 1]
  keyValue[0 0 0, 1 1 0, 0 2 0, 2 3 0, -1 4 0, 5 5 0]
  }
  
  DEF sphere Transform {
  children [
  Shape {
        appearance Appearance {
          material Material {
            diffuseColor 0 1 0
                    emissiveColor 1 0 0
          }
        }
        geometry Transform {

  children [

  Shape {

        appearance Appearance {

          material Material {

            diffuseColor 0 1 0

     §2.html>Sphere {radius .1}
  }
  ]
  }
  
  

timer and routing


  
  DEF spherets TimeSensor { loop TRUE cycleInterval 10 }
  
  ]
  }
  
  ROUTE spherets.fraction_changed TO NurbsInt.set_fraction
  ROUTE NurbsInt.value_changed TO sphere.set_translation
  


(C) A. Eliëns 21/5/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.