home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / DemoApps / Graphics / 2D_3D / Tester3D / articleExtensions < prev    next >
Encoding:
Text File  |  1990-07-12  |  1.9 KB  |  14 lines

  1. The drawing routines are simple, and use an easy perspective projection. To get a zoom View, put the pictureDistance at a large negative z value. Put whatever objects you wish to view at a similar distance. The resulting image will have little perspective. To increase the perspective effects, bring the pictureDistance close to zero.
  2.  
  3. The Cube class provided is very simple. Since the polygons are declared locally within the render method, the fact that Transformation3D's operateOn: and operateOn:howMany: are destructive (that is, manipulate the data passed at the memory location passed) is meaningless. If you create an object on the fly, or declare variables which hold the definition of the object, you must pass copies to moveto:, lineto: and polygon:howMany:.
  4.  
  5. Play around with the Linear3D transformation and the Cube, using translation in the negative z direction to get the rendering to show on screen (rather than
  6. behind it). Large negative z values will put the objects far off into the distance, so they will be small. If you haven't had linear algebra, play around with concatinating various Linear3D transformations in various orders. To rotate a cube, say, rotate first, then push it back on the z axis. This will rotate the cube around it's origin. If you do the operations in the reverse order, the cube will rotate around the viewer such that a 180 degree rotation would put the cube behind the screen.
  7.  
  8. Try creating a few simple 3D objects as well, like tetrahedrons, etc. Static objects are easiest, since you can just modify the Cube directly. Try some heirarchical objects, such as a finger, using subviews of subviews. Modify the code, to make it better or faster. Make it collect up polygons in a list and then use a hidden line algorithm for the actual rendering.
  9.  
  10. Again this is a simple example, feel free to improve on it, modify it, or rewrite it your own way.
  11.  
  12. Dan
  13.  
  14.