home *** CD-ROM | disk | FTP | other *** search
/ Late Night VRML 2.0 with Java CD-ROM / code.zip / Ch15 / Refine.wrl < prev    next >
Text File  |  1997-01-23  |  3KB  |  95 lines

  1. #VRML V2.0 utf8
  2.  
  3.  
  4. EXTERNPROTO NurbsCurve [ field SFBool   debug
  5.                          field SFInt32  segments
  6.                          field MFFloat  knotSequence
  7.                          field MFFloat  controlPoints ]
  8. "http://www.ocnus.com/NURBS/NurbsCurve.wrl"
  9.  
  10.  
  11.  
  12. Viewpoint {
  13.   position       0 0 5
  14.   orientation    0 0 1  0
  15.   fieldOfView    0.785398
  16.   description    "NURBS Circle"
  17. }
  18.  
  19. Shape {
  20.   appearance
  21.       Appearance {
  22.         material
  23.            Material { diffuseColor 1 0 0 }
  24.       }
  25.   geometry
  26.       NurbsCurve {      # Circle
  27.         segments        0
  28.         debug           FALSE
  29.         knotSequence  [ 0.00, 0.0, 0.0, 0.25, 
  30.                         0.25, 0.5, 0.5, 0.75, 
  31.                         0.75, 1.0, 1.0, 1.00 ]
  32.         controlPoints [ 1         0         0   1,
  33.                         0.707107  0.707107  0   0.707107,
  34.                         0         1         0   1,
  35.                        -0.707107  0.707107  0   0.707107,
  36.                        -1         0         0   1,
  37.                        -0.707107 -0.707107  0   0.707107,
  38.                         0        -1         0   1,
  39.                         0.707107 -0.707107  0   0.707107,
  40.                         1         0         0   1,        ]
  41.  
  42.       }
  43. }
  44.  
  45. Shape {
  46.   appearance
  47.       Appearance {
  48.         material
  49.            Material { diffuseColor 0 1 0 }
  50.       }
  51.   geometry
  52.       NurbsCurve {      # Circle
  53.         segments        13
  54.         debug           FALSE
  55.         knotSequence  [ 0.00, 0.0, 0.0, 0.25, 
  56.                         0.25, 0.5, 0.5, 0.75, 
  57.                         0.75, 1.0, 1.0, 1.00 ]
  58.         controlPoints [ 1         0         0   1,
  59.                         0.707107  0.707107  0   0.707107,
  60.                         0         1         0   1,
  61.                        -0.707107  0.707107  0   0.707107,
  62.                        -1         0         0   1,
  63.                        -0.707107 -0.707107  0   0.707107,
  64.                         0        -1         0   1,
  65.                         0.707107 -0.707107  0   0.707107,
  66.                         1         0         0   1,        ]
  67.  
  68.       }
  69. }
  70.  
  71. Shape {
  72.   appearance
  73.       Appearance {
  74.         material
  75.            Material { diffuseColor 1 1 0 }
  76.       }
  77.   geometry
  78.       NurbsCurve {      # Circle
  79.         debug           FALSE
  80.         segments        200
  81.         knotSequence  [ 0.00, 0.0, 0.0, 0.25, 
  82.                         0.25, 0.5, 0.5, 0.75, 
  83.                         0.75, 1.0, 1.0, 1.00 ]
  84.         controlPoints [ 1         0         0   1,
  85.                         0.707107  0.707107  0   0.707107,
  86.                         0         1         0   1,
  87.                        -0.707107  0.707107  0   0.707107,
  88.                        -1         0         0   1,
  89.                        -0.707107 -0.707107  0   0.707107,
  90.                         0        -1         0   1,
  91.                         0.707107 -0.707107  0   0.707107,
  92.                         1         0         0   1,        ]
  93.       }
  94. }
  95.