TUTORIAL FOR 4DVIEW Welcome to the wonderful world of 4dview, the program that lets you explore the complex and entrancing world of 4 dimensions. The purpose of this tutorial is to help you, the user, learn how to use 4dview by teaching you the basic principles behind how the program works as well as walking you through how to use 4dview by looking at several example objects. First of all, what is 4dview? 4dview is a program designed to accept the geometry of a 4-d or less object specified in the OOGL format, and then display projections of it in a graphics window on a workstation. 4dview relies heavily on geomview for displaying the projections as well as for providing much of the interactive control we have over the 3-dimensional aspect of the projections generated by 4dview. We assume here that you have at least some basic acquaintance with geomview. If not, you should probably first read the geomview 'overview' and 'oogltour' documentation files as well as experimenting with geomview independent from 4dview. That last thing we should mention about 4dview is that in addition to showing projections it provides the ability to 'cut' any object being viewed with an arbitrary hyperplane. This can be very useful for certain applications. Now that we know what 4dview is, let's see how it does what it does. It was stated that 4dview displays or generates projections of the 4-d object being examined. What this means is simply, we take each vertex of the object, which can be specified by a quaternion (x, y, z, w), apply a 4x4 matrix to it and then drop the w coordinate. In other words: | a b c d | | e f g h | (x, y, z, w) | i j k l | = (x', y', z', w') --> (x', y', z') | m n o p | To find an interesting projection we must find the right 4x4 matrix. 4dview allows us to do this since we can specify explicitly what matrix we want to use. This is sometimes called an orthogonal projection. In addition, 4dview supports perspective projection. This type of projection is useful when we want the apparent size of an object to shrink with its distance from us in w. Perspective projection is accomplished by doing the usual procedure for the orthogonal projection but then dividing x', y' and z' by w' as a final step. Another way that 4dview tries to maintain the information in the w coordinate is by using the value to decide how to color each vertex. Vertices with larger values of w (further away) are colored red, whereas vertices with smaller values of w (closer) are colored blue. Now that we know a little about how 4dview works let's jump right in and try using it. First, run geomview. Scroll the applications browser in geomview until 4dview is visible and then click on 4dview. The main panel of 4dview will soon appear. To load an object we type the name of the file containing the object's geometry into the space provided on the main panel and click on load. The first object we are interested in looking at is a simple 3-d cube. Type 'cube' into the text-box on the main panel and click on load. If 4dview is unable to find the file in the local directory it will complain by printing 'Couldn't read file' to standard error. If this is the case, try locating the file in the filesystem and then typing in its full path before clicking on load. If everything works a red cube should appear in the geomview graphics window. Now, let's look at the options available to us in 4dview. In addition to the main panel, 4dview has three sub-panels containing features that will allow us to modify the projection and actual geometry of the object being viewed. The projection panel is what we will use most frequently so click on the projection button to bring the panel up. The projection panel contains the actual projection matrix which is being used. Notice that it always starts out being the identity matrix. Also, clicking on the default projection button will always bring it back to the identity so don't be afraid to fiddle around with matrix values all you want. There are two ways we can change the projection, changing the values directly, or using the projection axis we see on the left. To change the projection using the projection axis you can use either the left or the right mouse buttons while dragging across it. For now, let's stick to the right mouse button. Hold down the right mouse button and drag across the projection axis controller towards the right. The red cube in the window should begin distorting and changing color. One face of the cube grows larger and the other grows smaller. This is because we are in perspective projection by default. To get the right color effect it is necessary to be in smooth shading mode in geomview. Another sub-panel in 4dview is the features sub-panel. This sub-panel actually lets us switch between orthogonal and perspective projection. Click on the features button on the main panel to bring it up. Click on orthogonal and notice how the projection changes. Feel free to experiment with the projection axis or type different values into the projection matrix to see how they affect the picture we are seeing. If things get too wierd just click on default projection. You can spin the projection around in 3-dimensions by dragging across the geomview window. Now that we are a little more familiar with the mechanics of projection lets try out the slicing capabilities of 4dview. Click on the slicing button of the main panel. This brings up the slicing panel. Notice that there are five numbers on the left side. These represent the coefficients of the equation defining the position of an arbitrary hyperplane. This is our slicing hyperplane. Try typing the following values into the panel in order 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, D=0.0, and E = 0.0. Notice that some of the vertices are now colored white. This signifies that these vertices will be gone once the slicing has been completed. They help to give us a rough idea of where the slicing is taking place. Now, click on slice. You should now see the insides of the cube revealed as one half of it is now gone, having been cut away. Rather than typing in values for the hyperplane, we could have used the slider to specify E and the slicing plane normal controller (which behaves just like the projection axis) to generate A, B, C, and D. Clicking on the flip button switches on which side of the hyperplane things will be removed Feel free to experiment with all the features of the slicing panel. Now that we are more familiar with 4dview, we can use it to look at some true 4 dimensional objects. Here is a list of some filenames to try: hypercube.off : "A hypercube with the front and back hyperfaces removed" onetwist.off : "A knotted sphere. You can't do that in 3D!"