Math 351 Summer 1993 George Francis, Chris Hartman, Glenn Chappell 21 June - 2 Jul Renaissance Experimental Laboratory (REL) 3414 Beckman National Center for Supercomputing Applications (NCSA) University of Illinois at Urbana-Champaign (UIUC) Welcome to the second annual workshop in Visual Mathematics: Computer Graphics for the Classroom sponsored by the Educational Service Center #13, State of Illinois, the UIUC, and the NCSA, and supported by grants from the Illinois Board of Higher Education and the NSF. This document summarizes information about the real-time interactive computer animator (RTICA), illiConic, which we will use in REL. It is based on the original program designed and programmed by Loren Evans for his semester project in Math 428, Geometrical Computer Graphics. At the time, he was a graduate student in computer science on leave from his high-school teaching position. Earlier, he received his BA from UIUC in mathematics with high honors. We include the abstract for his project. His program was extensively modified and augmented by mathematics graduate student Chris Hartman last year, both before, during and after the first workshop. In preparation for the second workshop, we rewrote the program from ground up. It now conforms with the illiView paradigm as developed by Francis, Chappell and Hartman. While thus making it easier to customize this RTICA to the individual needs of each workshop participant, we have preserved Loren's original pedagogical philosophy. ___________________________________________________________________________ Math 428 Fall 1990 Prof. Francis 02-Nov-90 Name: Loren Evans Signon name: levans Project title: conics Abstract ======== The goal of this project is to produce an interactive program that allows the user to generate conic sections visually and geometrically as opposed to algebraically, and to view the resultant curves and intersecting surfaces in three dimensions. Allowing real-time interaction with the cutting plane and the generating cones should provide a very concrete visualization of the algebraic concept of a conic section. The opportunity to explore various relationships with this visualization tool should be helpful to anyone interested in quadratic equations and geometric relation- ships between algebraic entities. Geometric Features ------------------ The initial project emphasis will be to produce, on screen, a pair of generating cones and a cutting plane whose relative positions can be changed interactively by the user. At present, I've implemented both of these items in crude fashion and am exploring ways to enhance both their appearance and the speed with which they can be displayed. The project as I see it will contain these features: 1) Fixed position generating cones with axis along the y-axis. The cone surface may be composed of solid shading, wire grid, or a combination of the two. 2) A single cutting plane in space which intersects the generating cones to form planar curve(s) called a conic section. 3) Highlighted drawing of the resulting planar curve (the conic section) produced by the intersection of the cone(s) and the plane. This will initially be drawn with a Cardinal spline, though there may be other means to draw the curve that are faster and cheaper. (more) Graphics Features ----------------- The surface of the cone is currently being generated using a series of t-mesh ribbons and single color shade. Other possibilities that may be investigated include simple polygon rendering with triangles and trapezoids. The wire mesh that covers the surface of cones is used to provide visual reference to the movement of the viewer and the cutting plane. This mesh consists wholly of polylines and can be toggled on/off. A light source will be added to the Conic Viewer to provide some shading and highlighting of the surfaces, especially the curvature of the cone. This lighting algorithm will initially be the "fast" lighting model introduced in class. Cardinal splines may be used to construct the curves formed by the intersecting cones and plane, though speed of rendering may dictate the method used to represent these conic sections. The goal is to allow the user to see and modify the conic sections interactively, so graphics performance will be considered in selecting a rendering method. Interactive Animation --------------------- A prime goal of the Conic Viewer is to provide the user with a real- time model of intersecting cones and plane. The user interface will be designed to allow intuitive, simple, and visually-oriented methods for modifying the graphic image on the screen. Some of the features of this interface are: 1) User-controllable viewing options for the 3-D figures: . Change viewing eye coordinates . Change viewing eye line-of-sight . Select automatic viewing position for a planar view of the conic section. This places the viewing eye on a normal of the plane with line-of-sight along the normal toward the plane. 2) Use of pop-up menus to allow the user easy access to the parameters of the interface. After choosing a set of parameters to change, the user will interactively adjust the viewing and geometrical variables using the mouse and/or keyboard. 3) Ability to simultaneously modify several parameters through use of specially-mapped keyboard keys and mouse position. This gives the user convenient and efficient modification of the viewing position and viewed object. 4) Provision for specifying new initial default parameters at program runtime using command-line arguments. This facility may be able to overlap some of the functionality of the pop-up menu system so that scripting of an interactive session may be possible. In addition to the minimal goals defined above, I have a list of other enhancements that I would like to effect if time allows during the semester. These include (but will not necessarily be ordered as shown): 1) Real-time display of the algebraic equations of the surfaces, planes, and lines being manipulated. This would involve simply learning how to call the appropriate text-display routines. 2) Generalized viewing of planes and intersecting planes in the 3-D coordinate system. This would be a neat tool for second- year algebra students. 3) Generalized viewing of quadric surfaces in addition to cones. 4) More efficient input methods for user interaction, including more intuitive use of mouse and keyboard and screen-aided input techniques. ---------------------------------------------------------------------------- Notes: We have abandoned the pop-up menus in favor of a heads-up display in accordance with Loren's intentions above. ____________________________________________________________________________ Instructions for operating illiConic93. ---------------------------------------------------------------------------- The entire scene consists of some or all of the following geometrical actors: the double cone, its wireframe, the slicing plane, the curve, the two tangent beads, the normal vector to the plane, and the message screen which reminds you of the key to press and the value of the parameter the key-presses change. ____________________________________________________________________________ Top line on the heads-up message screen: o To (ESC)ape ... the program. If this doesn't work, press the (ALT)+(RIGHTMOUSE) keys for a quitting menu. o To (Z)ap ... the current scene and return to the default set. o Toggle space(BAR) ... to switch the center of rotation between the viewer and the cone-vertex. Move the mouse into the bullseye to stop rotating. To fly about the scene, use the flying mode (white bullseye) so that you move to where the mouse-arrow points. o Hold (MIDDLEMOUSE) ... to fly forward at one of four speeds selected by pressing the ... o (1) (2) (3) (4) ... keys. To fly backwards ... o Hold (SHIFT)key ... In general, the shift-key `reverses' the action of other keys that change parameters. o Hold (ALT)key ... to slow the these changes for finer adjustment. --------------------------------------------------------------------------- The (SHIFT) and (ALT) keys, in combination with certain other keys, causes their action to be coarse or fine. This is called a VERNIER. --------------------------------------------------------------------------- o (RIGHTMOUSE) (LEFTMOUSE) ... tilts your space-probe about its axis. o Cycle (V)iew ... through a large single image, a side-by-side pair for cross-eyed binocular viewing, and an up-down pair for viewing with a stereographics board in certain Irises. o Cycle (L)ine ... through various auxiliary line-drawing options. (None are implemented at the moment.) o Toggle (`) ... to turn off/on the stars in the background. The stars enhance navigation while flying, but slow down animation on slow Irises. o Toggle (PRSCR) ... to turn off/on the heads-up display. ---------------------------------------------------------------------------- The keys on the right side of the message board affect special features. Read about them below before experimenting with them. ---------------------------------------------------------------------------- o Toggle (C)one ... to turn the cone surface on and off. o Toggle (W)ireframe ... to turn the wireframe on and off. o Toggle (P)lane ... to turn the plane on or off. o Toggle (B)ead(S) ... to turn the beads, resp. their spherical loxodromic wireframes on or off. o Toggle (Q)ube ... to turn a stick-cube on or off. o Toggle (D)ouble ... to turn off/on the other cone nappe. o Vernier (K)appa ... adjusts the cone-angle kappa. o Vernier (H)eight ... adjusts the cone-height. --------------------------------------------------------------------------- --------------------------------------------------------------------------- The plane is controlled by keys on the ``pad'' on the far right. --------------------------------------------------------------------------- o Toggle norma(/) ... to turn a line-segment from the cone-vertex normal to the slicing plane. o Vernier phi(5)ve ... adjusts the plane angle phi. o Vernier (+)(-) ... adjusts the plane's distance from the cone vertex. o (8)(6)(4)(2) NEWS ... move the rectangle north-east-west-south in plane. o Toggle (A)ltitudes ... untie the beads from the plane. o Vernier (ARROWKEYS) ... (UP) (DN) to move the two beads independently. o Vernier (E)psilon ... inflate/deflate the beads by this much. ---------------------------------------------------------------------------- o Toggle (PG DN) ... to write a movie, which is an animation control file. If you forget to redirect output you can copy a short movie into a file from the window after you escape the RTICA. o Press (F12) ... to read a movie. If you forget to redirect input from a valid movie file you will hang the RTICA and must use the (ALT)+(RIGHTMOUSE) quit menu. o Toggle (*) ... to reverse the background color, for color prints. o Press (HOME)(END) ... to freeze/unfreeze animation for photography. o Vernier (F1)amb ... to adjust the ambient light fraction. o Vernier (F2)spec ... to adjust the specular light ramp slope. o Vernier (N)ose ... uncalibrated distance from nose to eye. o Vernier f(O)cal ... to move between wide angle and telephoto lens. o Vernier s(I)ze ... to adjust size of the space-probe. This key affects the near-clipping plane. Movies: To make a movie, start with a command line that looks like this: iris% conic.x > moviename.m When you are ready to start "recording" the movie, press the (PAGEDOWN)key. You may want to hold it down for a second to make sure it registers. Now proceed to use the program normally, and it will record everything you do. The (SHIFT)(PAGEDOWN)keys stops the movie until you wish to go on. When you are done making your movie, just (ESC)ape the program. To watch a movie, start up the program with iris% conic.x < moviename.m To start the movie, press the (F12)key. When the movie is done you may continue normally. It is possible to read from one movie and into another but the effect is not what you would expect from this feature. Experiment! iris% conic.x < oldmovie.m > newmovie.m You can catenate several movies together thus iris% cat movie1.m movie2.m movie3.m | conic.x Movies are more correctly called animation control files (ACFs) and, with some difficulty, you can also edit them by hand with a Unix editor. For this you need to understand the format of the ACF. This will be documented in a later handout. Finally, certain infrequently changed parameters can be set on the the command line when you first call the program. For example iris% conic.x -u 0. 0. 1. illuminates the rendered objects head on from the observer, something like headlights. Only the direction, not the distance of the spotlight is used. Command Line Parameters ======================= Switch Description Default -------------------------------------------------------------------------- -w Window shape: full-screen 0 Open your own, re-move, re-size (no messages.) 1 Lower left hand corner only, for NTSC standard. 2 Full screen, full messages. -u Light source: 1. 2. 3. Only the light direction is used. Try other directions and observe the bead lighting. -t Thickness of wires: 2 -c Cone color. (Purple) 0x881155 -v Curve color. (Red) 0x0000ff -p Plane color at 4 corners. (mostly Greens) -b Bead color (saturated Blue)) 0xff1111 Other bead color (softer Cyan) 0xaaaa11 Bead wire color (pastel Blue) 0xff8888 Other bead wire (pastel Cyan) 0xffff88 The color bytes are blue.green.red.