home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / doc / 4dview.tutorial next >
Encoding:
Text File  |  1993-03-02  |  6.7 KB  |  116 lines

  1. TUTORIAL FOR 4DVIEW
  2.  
  3. Welcome to the wonderful world of 4dview, the program that lets you explore
  4. the complex and entrancing world of 4 dimensions. The purpose of this tutorial
  5. is to help you, the user, learn how to use 4dview by teaching you the basic
  6. principles behind how the program works as well as walking you through how
  7. to use 4dview by looking at several example objects.
  8.  
  9. First of all, what is 4dview? 4dview is a program designed to accept the
  10. geometry of a 4-d or less object specified in the OOGL format, and then
  11. display projections of it in a graphics window on a workstation. 4dview relies
  12. heavily on geomview for displaying the projections as well as for providing
  13. much of the interactive control we have over the 3-dimensional aspect of the
  14. projections generated by 4dview. We assume here that you have at least some
  15. basic acquaintance with geomview. If not, you should probably first read the
  16. geomview 'overview' and 'oogltour' documentation files as well as experimenting
  17. with geomview independent from 4dview. That last thing we should mention
  18. about 4dview is that in addition to showing projections it provides the
  19. ability to 'cut' any object being viewed with an arbitrary hyperplane. This
  20. can be very useful for certain applications.
  21.  
  22. Now that we know what 4dview is, let's see how it does what it does. It was
  23. stated that 4dview displays or generates projections of the 4-d object being
  24. examined. What this means is simply, we take each vertex of the object,
  25. which can be specified by a quaternion (x, y, z, w), apply a 4x4 matrix to it
  26. and then drop the w coordinate. In other words:
  27.  
  28.         | a  b  c  d |
  29.         | e  f  g  h |
  30.    (x, y, z, w) | i  j  k  l |  =  (x', y', z', w')  -->  (x', y', z')
  31.         | m  n  o  p |
  32.  
  33. To find an interesting projection we must find the right 4x4 matrix. 4dview
  34. allows us to do this since we can specify explicitly what matrix we want to
  35. use. This is sometimes called an orthogonal projection. In addition, 4dview
  36. supports perspective projection. This type of projection is useful when we
  37. want the apparent size of an object to shrink with its distance from us in w.
  38. Perspective projection is accomplished by doing the usual procedure for
  39. the orthogonal projection but then dividing x', y' and z' by w' as a final
  40. step. Another way that 4dview tries to maintain the information in the w
  41. coordinate is by using the value to decide how to color each vertex. Vertices
  42. with larger values of w (further away) are colored red, whereas vertices
  43. with smaller values of w (closer) are colored blue.
  44.  
  45. Now that we know a little about how 4dview works let's jump right in and
  46. try using it. First, run geomview. Scroll the applications browser in geomview
  47. until 4dview is visible and then click on 4dview. The main panel of 4dview
  48. will soon appear. To load an object we type the name of the file containing
  49. the object's geometry into the space provided on the main panel and click on
  50. load.
  51.  
  52. The first object we are interested in looking at is a simple 3-d cube. Type
  53. 'cube' into the text-box on the main panel and click on load. If 4dview is
  54. unable to find the file in the local directory it will complain by printing
  55. 'Couldn't read file' to standard error. If this is the case, try locating
  56. the file in the filesystem and then typing in its full path before clicking
  57. on load. If everything works a red cube should appear in the geomview
  58. graphics window.
  59.  
  60. Now, let's look at the options available to us in 4dview. In addition to
  61. the main panel, 4dview has three sub-panels containing features that will
  62. allow us to modify the projection and actual geometry of the object
  63. being viewed. The projection panel is what we will use most frequently so
  64. click on the projection button to bring the panel up.
  65.  
  66. The projection panel contains the actual projection matrix which is being
  67. used. Notice that it always starts out being the identity matrix. Also,
  68. clicking on the default projection button will always bring it back to the
  69. identity so don't be afraid to fiddle around with matrix values all you want.
  70. There are two ways we can change the projection, changing the values directly,
  71. or using the projection axis we see on the left. To change the projection
  72. using the projection axis you can use either the left or the right mouse
  73. buttons while dragging across it.
  74.  
  75. For now, let's stick to the right mouse button. Hold down the right mouse
  76. button and drag across the projection axis controller towards the right. The
  77. red cube in the window should begin distorting and changing color. One face
  78. of the cube grows larger and the other grows smaller. This is because we
  79. are in perspective projection by default. To get the right color effect it
  80. is necessary to be in smooth shading mode in geomview.
  81.  
  82. Another sub-panel in 4dview is the features sub-panel. This sub-panel actually
  83. lets us switch between orthogonal and perspective projection. Click on the
  84. features button on the main panel to bring it up. Click on orthogonal and
  85. notice how the projection changes.
  86.  
  87. Feel free to experiment with the projection axis or type different values
  88. into the projection matrix to see how they affect the picture we are seeing.
  89. If things get too wierd just click on default projection. You can spin the
  90. projection around in 3-dimensions by dragging across the geomview window.
  91.  
  92. Now that we are a little more familiar with the mechanics of projection lets
  93. try out the slicing capabilities of 4dview. Click on the slicing button of
  94. the main panel. This brings up the slicing panel. Notice that there are
  95. five numbers on the left side. These represent the coefficients of the
  96. equation defining the position of an arbitrary hyperplane. This is our
  97. slicing hyperplane. Try typing the following values into the panel in order
  98. from top to bottom. (0.5 0.5 0.5 0.0 0.0) in other words A=0.5, B=0.5, C=0.5,
  99. D=0.0, and E = 0.0. Notice that some of the vertices are now colored white.
  100. This signifies that these vertices will be gone once the slicing has been
  101. completed. They help to give us a rough idea of where the slicing is taking
  102. place. Now, click on slice. You should now see the insides of the cube
  103. revealed as one half of it is now gone, having been cut away.
  104.  
  105. Rather than typing in values for the hyperplane, we could have used the
  106. slider to specify E and the slicing plane normal controller (which behaves
  107. just like the projection axis) to generate A, B, C, and D. Clicking on
  108. the flip button switches on which side of the hyperplane things will be removed
  109. Feel free to experiment with all the features of the slicing panel.
  110.  
  111. Now that we are more familiar with 4dview, we can use it to look at some
  112. true 4 dimensional objects. Here is a list of some filenames to try:
  113.  
  114. hypercube.off : "A hypercube with the front and back hyperfaces removed"
  115. onetwist.off  : "A knotted sphere. You can't do that in 3D!"
  116.