home *** CD-ROM | disk | FTP | other *** search
/ Late Night VRML 2.0 with Java CD-ROM / code.zip / Ch15 / BezierSurface.wrl < prev    next >
Encoding:
Text File  |  1997-01-29  |  2.0 KB  |  64 lines

  1. #VRML V2.0 utf8
  2.  
  3.  
  4. EXTERNPROTO NurbsSurface [ field SFBool   debug
  5.                            field SFInt32  uSegments
  6.                            field SFInt32  vSegments
  7.                            field MFFloat  uKnotSequence
  8.                            field MFFloat  vKnotSequence
  9.                            field SFInt32  numUControlPoints
  10.                            field SFInt32  numVControlPoints
  11.                            field MFFloat  controlPoints
  12.                            field SFBool   ccw
  13.                            field SFFloat  creaseAngle
  14.                            field SFBool   solid             ]
  15. "http://www.ocnus.com/NURBS/NurbsSurface.wrl"
  16.  
  17.  
  18.  
  19. Viewpoint {
  20.   position       0 0 25
  21.   orientation    0 0 1  0
  22.   fieldOfView    0.785398
  23.   description    "NURBS Bezier Surface"
  24. }
  25.  
  26. Shape {
  27.   appearance
  28.       Appearance {
  29.         material
  30.            Material { diffuseColor 1 1 0 }
  31.         texture
  32.            ImageTexture { url "quilt.gif" }
  33.       }
  34.   geometry
  35.       NurbsSurface {      # Bezier Surface
  36.         debug             FALSE
  37.         creaseAngle       0.5
  38.         uSegments         20
  39.         vSegments         20
  40.         uKnotSequence  [  0,  0,  0,  0,
  41.                           1,  1,  1,  1, ]
  42.         vKnotSequence  [  0,  0,  0,  0,
  43.                           1,  1,  1,  1, ]
  44.         numUControlPoints   4
  45.         numVControlPoints   4
  46.         controlPoints [ -9  -2   8  1,
  47.                         -4   1   8  1,
  48.                          4  -3   6  1,
  49.                         10  -1   8  1,
  50.                         -6   3   4  1,
  51.                          0  -1   4  1,
  52.                          2  -1   4  1,
  53.                          6   2   4  1,
  54.                        -10  -2  -2  1,
  55.                         -4  -4  -2  1,
  56.                          4  -1  -2  1,
  57.                         10   0  -2  1,
  58.                         -9   2  -6  1,
  59.                         -4  -4  -5  1,
  60.                          4   3  -5  1,
  61.                          9  -2  -6  1, ]
  62.       }
  63. }
  64.