home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / 3d / irit / scripts / macros.irt < prev    next >
Encoding:
Text File  |  1994-03-30  |  3.3 KB  |  132 lines

  1. #
  2. # Test file for the macros defined in iritinit.irt
  3. #
  4.  
  5. min(1, -5);
  6. min(5, min(10, 15));
  7. min(1, sin(45 * Pi / 180));
  8.  
  9. max(1, -5);
  10. max(5, max(10, 15));
  11. max(1, sin(45 * Pi / 180));
  12.  
  13. sqr( sin(45 * Pi / 180));
  14. sqr(-sin(45 * Pi / 180) / 2);
  15.  
  16. normalize( vector( 5, 2, 6 ) );
  17. normalize( point( 1, -2, 5 ) );
  18.  
  19. midPoint( point( 0, 1, 15 ), point( 10, 2, -5 ) );
  20. midPoint( normalize( vector( 0, 10, 15 ) ),
  21.       normalize( vector( 10, 2, -5 ) ) );
  22.  
  23. InterpPoint( point( 0, 1, 15 ), point( 10, 2, -5 ), 0.1 );
  24. InterpPoint( vector( 0, 1, 15 ), vector( 10, 2, -5 ), 1.1 );
  25.  
  26. ed1 = edge2d(  0,  0,  1,  1 );
  27. ed2 = edge2d( -1, -1, -1,  2 );
  28. ed3 = edge3d(  0,  0,  0,  1,  1,  1 );
  29. ed4 = edge3d( -1,  0,  1,  1,  2, -1 );
  30. interact( list( axes, ed1, ed2, ed3, ed4 ) );
  31. free( ed1 );
  32. free( ed2 );
  33. free( ed3 );
  34. free( ed4 );
  35.  
  36. Trs = torusSrf( 1.0, 0.2 );
  37. interact( Trs );
  38.  
  39. ScaleCrv = cbspline( 3,
  40.              list( ctlpt( E2, 0.05, 0.25 ),
  41.                ctlpt( E2, 0.1,  0.0 ),
  42.                ctlpt( E2, 0.2,  0.5 ),
  43.                ctlpt( E2, 0.3,  0.0 ),
  44.                ctlpt( E2, 0.4,  0.5 ),
  45.                ctlpt( E2, 0.5,  0.0 ),
  46.                ctlpt( E2, 0.6,  0.5 ),
  47.                ctlpt( E2, 0.7,  0.0 ),
  48.                ctlpt( E2, 0.8,  0.5 ),
  49.                ctlpt( E2, 0.85, 0.25 ) ),
  50.              list( KV_OPEN ) );
  51. SclTrs = SwpCircSrf( circle( vector( 0, 0, 0 ), 1 ), ScaleCrv, 2 );
  52. interact( SclTrs );
  53.  
  54. CtlPts = GetCtlPoints( ScaleCrv, off );
  55. CtlVecs = GetCtlPoints( ScaleCrv, on );
  56. CtlPoly = GetCtlPolygon( ScaleCrv );
  57. interact( list( ScaleCrv, CtlPts, CtlPoly ) );
  58. interact( list( ScaleCrv, CtlVecs, CtlPoly ) );
  59.  
  60. CtlPts = GetCtlMeshPts( Trs, off );
  61. CtlVecs = GetCtlMeshPts( Trs, on );
  62. CtlMesh = GetCtlMesh( Trs );
  63. interact( list( Trs, CtlPts, CtlMesh ) );
  64. interact( list( Trs, CtlVecs, CtlMesh ) );
  65.  
  66. Circ = circle( vector( 0, 0, 0 ), 1 );
  67. CircPly = CnvrtCrvToPolygon( Circ, 25 );
  68. Cyl = Extrude( CircPly , vector( 0, 0, 1 ) );
  69. interact( list( Cyl, CircPly, Circ ) );
  70.  
  71. cross = arc( vector( 0.2, 0.0, 0.0 ),
  72.          vector( 0.2, 0.2, 0.0 ),
  73.          vector( 0.0, 0.2, 0.0 ) ) +
  74.     arc( vector( 0.0, 0.4, 0.0 ),
  75.          vector( 0.1, 0.4, 0.0 ),
  76.          vector( 0.1, 0.5, 0.0 ) ) +
  77.     arc( vector( 0.8, 0.5, 0.0 ),
  78.          vector( 0.8, 0.3, 0.0 ),
  79.          vector( 1.0, 0.3, 0.0 ) ) +
  80.     arc( vector( 1.0, 0.1, 0.0 ),
  81.          vector( 0.9, 0.1, 0.0 ),
  82.          vector( 0.9, 0.0, 0.0 ) ) +
  83.     ctlpt( E2, 0.2, 0.0 );
  84. CrossPly = CnvrtCrvToPolygon( Cross, 50 );
  85. Cyl = Extrude( CrossPly , vector( 0, 0, 1 ) );
  86. interact( list( Cyl, CrossPly, Cross ) );
  87.  
  88. s = sphereSrf( 0.4 );
  89. interact( s );
  90. s = sphereSrf( 0.7 );
  91. interact( s );
  92.  
  93. s = torusSrf( 0.5, 0.4 );
  94. interact( s );
  95. s = torusSrf( 0.5, 0.05 );
  96. interact( s );
  97.  
  98. s = cylinSrf( 0.5, 0.4 );
  99. interact( s );
  100. s = cylinSrf( 0.5, 0.05 );
  101. interact( s );
  102.  
  103. s = coneSrf( 0.5, 0.4 );
  104. interact( s );
  105. s = coneSrf( 0.5, 0.05 );
  106. interact( s );
  107.  
  108. s = cone2Srf( 0.5, 0.4, 0.2 );
  109. interact( s );
  110. s = cone2Srf( 0.5, 0.5, 0.05 );
  111. interact( s );
  112.  
  113. s = boxSrf( 0.5, 0.4, 0.2 );
  114. interact( s );
  115. s = boxSrf( 0.8, 0.4, -0.3 );
  116. interact( s );
  117.  
  118. RotZ2Vec( vector( 1, 0, 0 ) );
  119. RotZ2Vec( vector( 0, 1, 0 ) );
  120. RotZ2Vec( vector( 0, 0, 1 ) );
  121. v = vector( 1, 2, 3 );
  122. RotVec2Z( v );
  123. w = RotVec2Z( v ) * v;
  124. w;
  125. RotZ2Vec( v ) * w;
  126.  
  127. a1 = arrow3d( point( 0, 0, 0 ), vector( 1, 1, 1 ), 1.5, 0.05, 0.5, 0.1 );
  128. a2 = arrow3d( point( 1, 0, 0 ), vector( -1.5, 0.5, 1 ), 1, 0.02, 0.2, 0.05 );
  129. a3 = arrow3d( point( 0, 0.6, 0.8 ),
  130.           vector( 0.5, 0.7, 0.3 ), 0.5, 0.01, 0.2, 0.02 );
  131. view( list( axes, a1, a2, a3 ), on );
  132.