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

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

Web3D/VR

a fish (called) nurb

scene


  #@extern @vr/extern/blaxxun/NurbsSurface.wrl
  
  # NavigationInfo { type ["EXAMINE","ANY"] }
  
  DEF v1 Viewpoint { position 0 0 10 }
  
  

proto


  
  PROTO mynurb [
  exposedField SFVec3f translation 0 0 0 
  exposedField MFVec3f cp [ ]
  exposedField MFString url "alchemy.gif"
  ]{
  
  

body


  Transform { translation IS translation
  rotation 1 0 0 1.57   ## some trick was needed
  scale 2 2 1
  children [
  Transform {
  translation -1.5 -1.5 0
  rotation 1 0 0 1.57
  children [
  Shape { 
  
  

the nurb surface


  geometry DEF surface NurbsSurface {
          uOrder 4 
          vOrder 3 
          uDimension 5 
          vDimension 3 
          uTessellation 50  ## needed
          vTessellation 30
          controlPoint IS cp
          }
  

appearance


  appearance Appearance {
       material Material { diffuseColor 0 0 1 emissiveColor 1 0 0}  # Blue
       texture ImageTexture { url IS url }
          }        
  } ] } ] } }
  
  

instances


  
  Group {
  children [
  mynurb {
  translation -3 3 0
  cp [ 
       0 0 0, 1 2 0, 2 0.5 0, 3 0.5 0, 4 1.5 0,
       0 0 0, 1 0 0, 2 0 0, 2 0 0, 2 0 0,
       0 0 0, 1 -2 0, 2 -0.5 0, 3 -0.5 0, 4 -1.5 0
       ]
  }
  
  

no 2


  mynurb {
  translation 0 0 0
  cp [ 
       0 0 0, 1 2 0, 2 2 0, 3 0.5 0, 4 2 0,
       0 0 0, 1 0 0, 2 0 0, 2 0 0, 2.5 0 0,
       0 0 0, 1 -2 0, 2 -0.5 0, 3 -1 0, 4 -1.5 0
       ]
  url "@logo.gif"
  }
  

no 3


  mynurb {
  translation 4 -4 0
  cp [ 
       0 0 0, 1 2 0, 2 2 0, 3 0.5 0, 4 2 0,
       0 0 0, 1 0 0, 2 0 0, 3 0 0, 3 0 0,
       0 0 0, 1 -2 0, 2 -2 0, 3 -0.5 0, 4 -2 0,
       ]
  url "alchemy.gif"
  }
  ]}
  


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