home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / DemoApps / Graphics / 2D_3D / Tester3D / Source / Context3D.h < prev    next >
Encoding:
Text File  |  1990-07-04  |  2.3 KB  |  91 lines

  1. /* Context3D.h */
  2.  
  3. #import <appkit/View.h>
  4. #import "3D.h"
  5.  
  6. @interface Context3D:View
  7. {
  8.     id contentView;
  9.     vector3D currentPoint;
  10.     float pictureDistance,clippingDistance;
  11. }
  12.  
  13.     /* 
  14.         contentView 
  15.             is the top of the View3D drawing hierarchy for this context.
  16.         currentPoint 
  17.             is the current drawing point, used by lineto: messages and altered by
  18.             moveto:, lineto: and polygon:howMany: messages 
  19.         pictureDistance
  20.             is the distance from the viewers eye to the virtual screen which 
  21.             the Context3D represents
  22.         clippingDistance
  23.             is the distance at which all closer drawing will not be drawn (clipped 
  24.             out)
  25.     */
  26.     
  27. + newFrame:(NXRect *)frameRect;
  28.  
  29.     /*
  30.         +newFrame: calls [View +newFrame:frameRect] to create the new View
  31.         object, and    then initiates it's instance variables. The following are 
  32.         initial Values:
  33.             contentView to a new View3D, which should be freed if changed.
  34.             currentPoint to {0.0,0.0,0.0}
  35.             pictureDistance to 1500.0
  36.             clippingDistance to 1.0
  37.     */
  38.             
  39. - moveto:(vector3D *)where;
  40.  
  41.     /*    -moveto: set's the currentPoint equal to *where. */
  42.  
  43. - lineto:(vector3D *)where;
  44.  
  45.     /*
  46.         -lineto: draws a line on screen from the currentPoint to where after 
  47.         projecting the current point and *where to the Context3D's coordinates
  48.         as a View. It leaves currentPoint == *where
  49.     */
  50.  
  51. - polygon:(vector3D *)vertices howMany:(int)count;
  52.  
  53.     /*
  54.         vertices must point to an array of count elements type vector3D.
  55.         -polygon: howMany: does the equivalent of a moveto: to the first
  56.         vector3D of vertices, and then lineto: to each succesive vertex
  57.         back to the first one.
  58.     */
  59.     
  60. - contentView;
  61.  
  62.     /* -contentView returns the id of the current contentView. */
  63.  
  64. - setContentView:anObject;
  65.  
  66.     /*
  67.         -setContentView: sets the id of the current contentView, and will
  68.         send [anObject setSuperView:self].
  69.     */
  70.  
  71. - setPictureDistance:(float)dist;
  72.  
  73.     /* 
  74.         sets the pictureDistance instance Variable to dist. dist must be 
  75.         a postitive number. If succesful, setProjection returns self, otherwise 
  76.         it returns nil.
  77.     */
  78.  
  79. - setClippingDistance:(float)dist;
  80.  
  81.     /* 
  82.         sets the clippingDistance instance Variable to dist. dist must be 
  83.         a postitive number. If succesful, setClipping returns self, otherwise 
  84.         it returns nil.
  85.     */
  86.  
  87. - drawSelf:(const NXRect *)rects:(int)rectCount;
  88.  
  89.     /* sends render to its contentView */
  90. @end
  91.