Mark Pingel CS638 - Introduction to Computer Graphics Dr. Gleicher ****************************************************************************************** USER MANUAL ****************************************************************************************** ****************************************************************************************** MODES OF OPERATION ****************************************************************************************** In this program, there are two general modes of operation. You can either be in drawing mode or in animation mode. Drawing mode allows you to create new objects, pin them together, and change their overall appearance through translations, rotations, scalings, or color alterations. Animation mode only allows you to animate objects that have already been made and pinned the way you would like them to be. DRAWING MODE: When the program is initially started, it is automatically in drawing mode. ANIMATION MODE: In order to set the program into animation mode, you must depress the button that says "ANIMATE". You will notice the interface changes when you enter animation mode and the options for pinning and creating new objects, as well as changing the stacking order disappear. ****************************************************************************************** CREATING (DRAWING) OBJECTS ON THE SCREEN ****************************************************************************************** There are two general classes of objects that are allowed to be drawn in this program: rectangles and polygons. In order to draw either object on the screen, you must do two things first. 1) Make sure that you are in CREATION mode. Press the CREATION check button in the upper left hand part of the interface. You'll see a green light appear on the left side of this button if it is active. Note, you don't need to push this button if the green light already appears next to CREATION. 2) Choose a color to draw the object in. At the botton of the screen there is a color chooser window that allows you to choose a specific color with which to draw the object. Move the tiny white square to be in the location of the color that you want your object to be. RECTANGLES: To draw a rectangle rectangle on the screen, you first need to be in RECTANGLE drawing mode. Underneath the series of check buttons in the upper left hand corner of the interface there is a menu with "SHAPE SELECTION" written underneath it. In this box there are two words in it. The word that is highlighted is the shape that will be drawn. Press the mouse button to highlight RECTANGLE, if it is not already highlighted. Press the left mouse button where you want one corner of the rectangle to be. Without releasing the mouse button, drag the mouse to where you want the opposite corner of the rectangle to be. This allows for rubberbanding rectangles. Release the mouse button when you are satisfied with the rectangle that appears on the screen. Repeat this process to draw additional rectangles. POLYGONS: To draw a polygon on the screen, you first need to be in POLYGON drawing mode. Underneath the series of check buttons in the upper left hand corner of the interface there is a menu with "SHAPE SELECTION" written underneath it. In this box there are two words in it. The word that is highlighted is the shape that will be drawn. Press the mouse button to highlight POLYGON, if it is not already highlighted. Press and release the left mouse button where you want the first vertex of the polygon to be. To add additional points, keep pressing and releasing the left mouse button where you want the additional vertices to be located. Note, you may drag the left mouse button to "rubberband" where a vertex will be located. The vertex will not be added until you release the left mouse button. When you are satisfied with the polygon that you have drawn, press and release the right mouse button. NOTE: Make sure to do this; if you forget to press the right mouse button, your shape will NOT be added into the drawing. ****************************************************************************************** PINNING TWO OBJECTS TOGETHER ****************************************************************************************** Two objects that have been drawn on the screen may be "pinned" together. This means that the object on top (appears towards the front of the screen) will become a child object to the object directly underneath it. A pin position serves as an axis of rotation for the child object and also forces a set connection between the two objects for translation events. To pin an object to another object. First make sure your two objects are aligned exactly how you want them to be. Make sure the object that you want to become the child is on top. If it is not, force it to be by changing the stacking order of the objects (See CHANGING THE STACKING ORDER). When the two objects are set up, switch into PINNING mode. To do this, press the PINNING check button in the upper left hand portion of the interface. You'll see a green light appear to the left of the word PINNING if it is active. Then, press the left mouse button in the window in the exact position where you want the pin to be. See DRAWING THE PIN POSITIONS to see exactly where the pin position occurred. CONSTRAINTS: Two objects can not be pinned if the parent object has been rotated or scaled. ****************************************************************************************** DRAWING THE PIN POSITIONS ****************************************************************************************** There is an option which toggles whether or not to display a little white square where two objects have been pinned. On the left hand side in the middle of the interface there is a light button that says SHOW PINS. If the box is colored in in yellow, these white squares will appear. If you do not wish for these white squares to appear, press the button to deactivate this. The yellow light in the box should "turn off". ****************************************************************************************** SELECTING AN OBJECT ****************************************************************************************** To select an object, which is the first step in changing its color, press the SELECTION check button in the upper left hand portion of the main interface. If you see a little green light next to the word SELECTION, the program is now in selection mode. To select an object, press the left mouse button over the object that you wish to select. You'll see a white border around the object that was selected. ****************************************************************************************** SCALING AN OBJECT ****************************************************************************************** First, change the mode into SCALING mode. In order to do this, press the SCALING light button in the upper left hand portion of the main interface. You'll see a green light appear next to the word SCALING if this mode is active. Next, press the left mouse button on the object that you wish to scale. You should see a white border appear around this object if it has been selected. Next, drag the left mouse button horizontally to scale along the X-axis and vertically to scale along the Y-axis. It's possible to scale along both axes at the same time if you're dragging the left mouse button in a diagonal fashion. Dragging the mouse to the right is a positive scaling along the X-axis, dragging to the left is a negative X-axis scale. Dragging the mouse up is a positive Y-axis scaling, while dragging the mouse down is a negative Y-axis scaling. Drag the mouse until you are satisfied with the scaling and then release the mouse button. If the object is a parent object, scaling the object will affect all of its kids. ****************************************************************************************** ROTATING AN OBJECT ****************************************************************************************** First, change the mode into ROTATION mode. In order to do this, press the ROTATION light button in the upper left hand portion of the main interface. You'll see a green light appear next to the word ROTATION if this mode is active. Next, press the left mouse button on the object that you wish to rotate. You should see a white border appear around this object if it has been selected. Next, drag the left mouse button horizontally to control the amount of rotation. Dragging the mouse to the right is a positive theta (counter- clockwise rotation) and dragging the mouse to the left is a negative theta (clockwise rotation). Drag the mouse until you are satisfied with its rotation and then release the mouse button. If the object that is being rotated is a parent object, rotating the object will affect all of the object's kids. ****************************************************************************************** TRANSLATING AN OBJECT ****************************************************************************************** First, change the mode into TRANSLATION mode. In order to do this, press the TRANSLATION light button in the upper left hand portion of the main interface. You'll see a green light appear next to the word TRANSLATION if this mode is active. Next, press the left mouse button on the object that you wish to translate. You should see a white border appear around this object if it has been selected. Drag the left mouse button anywhere on the screen that you wish to move the object. Release the left mouse button when you are satisfied with the object's position. If the object that is being translated is a parent, all of the objects kids will be affected by this movement. They are effected in that they move along with the parent according to their pin positions. ****************************************************************************************** CHANGING THE COLOR OF AN OBJECT ****************************************************************************************** First, change the mode into SELECTION mode (See SELECTING AN OBJECT). Then make sure you have selected an object on the screen. When you see the white border around the object, you may then change its color by selecting a new color using the color chooser at the bottom of the main interface window. As you move around that white square in the color chooser, you'll notice the color of your selected object changing dynamically as well. Stop whenever you are satisfied with the color of the object. Select a different shape to change its color as well. ****************************************************************************************** CHANGING THE STACKING ORDER ****************************************************************************************** In order to change the order in which objects are drawn on the screen, and subsequently how they are viewed, you need to change the stacking order. First, select the object whose position you wish to adjust (See SELECTING AN OBJECT). Then, you may move that object to one of two places: the front of the screen or the back of the screen. FRONT: To move the selected object to the front, press the Front option in the STACK ORDERING window. The STACK ORDERING window is located on the left side of the main interface right below the SHAPE SELECTION menu. You'll see the object appear in its new location when you have done this. BACK: To move the selected object to the back, press the Back option in the STACK ORDERING window. The STACK ORDERING window is located on the left side of the main interface right below the SHAPE SELECTION menu. You'll see the object appear in its new location when you have done this. ****************************************************************************************** CHOOSING AN INTERPOLATION METHODOLOGY ****************************************************************************************** First, make sure you are in animation mode. Then you may select between three different interpolation methodologies: Linear, Catmull-Rom, or Cardinal Spline. LINEAR: To use linear interpolation on key frames press the LINEAR option in the INTERPOLATION menu that is located near the upper third on the left hand side of the animation interface window. You'll see the option highlighted in red that is selected. CATMULL-ROM: To use catmull-rom spline interpolation on key frames press the CATMULL-ROM option in the INTERPOLATION menu that is located near the upper third on the left hand side of the animation interface window. You'll see the option highlighted in red that is selected. CARDINAL-SPLINE: To use cardinal spline interpolation on key frames press the CARDINAL-SPLINE option in the INTERPOLATION menu that is located near the upper third on the left hand side of the animation interface window. You'll see the option highlighted in red that is selected. Note: When you select CARDINAL-SPLINE interpolation a slider appears underneath this menu. This slider controls the tension parameter for how "tight" you want the curve to be. Positive numbers are tighter fitting curves and negative numbers are looser. ****************************************************************************************** DETERMINING IF A FRAME IS A KEY FRAME ****************************************************************************************** In order to determine if a frame is a key frame, you need only to look at the slider underneath the OpenGL drawing window. If the color of the slider is gray, then the frame is just a regular frame. If the color of the slider has turned to cyan, then this frame is a key frame. ****************************************************************************************** INSERTING NEW KEY FRAMES ****************************************************************************************** In order to insert a new key frame, adjust the slider underneath the OpenGL drawing window to display the number of the frame that you wish to make a Key Frame. If the color of the slider at this frame is cyan, and not gray, then this frame is already a key frame and you're not really adding a new key frame. Otherwise, at this frame number press the INSERT KEY button on the lower left hand side third of the animation interface. This frame has now become a Key Frame. Note: If you inserted a new Key Frame between two previous Key Frames, the animation sequence is automatically adjusted. Whichever interpolation method is the currently selected one is the one that now applies to all frames between the newly inserting Key Frame and the first previous Key Frame. Whichever interpolation method was used on the following Key Frame after the newly inserted one is applied to all frames between the newly inserted Key Frame and the first Key Frame following it. ****************************************************************************************** DELETING KEY FRAMES FROM ANIMATION ****************************************************************************************** To delete a Key Frame from an animation, you must first be on a key frame. (See DETERMINING IF A FRAME IS A KEY FRAME) for this. When you're currently on a Key Frame that you wish to delete, press the DELETE KEY button on the left hand side of the animation interface. This deletes this key frame from the animation sequence. Note: Deleting a Key Frame from an animation sequence will automatically cause a reinterpolation of all frames between the first Key Frame before and the first Key Frame after the Key Frame you just deleted. ****************************************************************************************** GENERAL STEPS FOR CREATING AN ANIMATION ****************************************************************************************** First, you have to make sure you are in animation mode (See MODES OF OPERATION). The next thing you want to do is to create some Key Frames. You can either do this by adding blank Key Frames as described in INSERTING NEW KEY FRAMES, or you can have this done for you automatically by adjusting scene components. To do this automatically, move the slider that appears underneath the OpenGL drawing window until the number that is displayed at its left is the frame number of the Key Frame that you wish you create. Now, you can make this frame become a Key Frame by translating, rotating, scaling, or altering the color of any shape in the scene at this frame number. See TRANSLATING AN OBJECT ROTATING AN OBJECT SCALING AN OBJECT CHANGING THE COLOR OF AN OBJECT for the specifics on how to do these parts. In drawing mode, when you released the left mouse button you just applied those operations to the shape in the drawing. In animation mode you cause the current frame to become a Key Frame. You also cause an interpolation from the old state of the altered shape to the new state you put it in. This interpolation is what actually causes the animation to occur as each frame is traversed. ****************************************************************************************** RUNNING AN ANIMATION ****************************************************************************************** In order to run an animation, you first need to have some Key Frames defined. See GENERAL STEPS FOR CREATING AN ANIMATION for this. Once you have these defined, you need only press the PLAY light button on the left hand side of the animation interface window to actually play the animation. In order to stop the animation from constantly repeating itself, which it will, deselect the PLAY button. The PLAY button is active when there is a little yellow light on the left hand side of the word PLAY illuminated. NOTE: The animation will run in a continuous loop from frame 0 (Key Frame by default) to the last Key Frame. In other words, if your last Key Frame is Frame 125, the animation will only play from frame 0 to frame 125. ****************************************************************************************** CONTROLLING THE SPEED OF AN ANIMATION ****************************************************************************************** You may find that the animation moves to fast for you to explicitly see everything that is going on. Therefore, there is a way that you can slow down and change the speed of the animation. Directly above the PLAY light button is a slider called ANIMATION SPEED. This slider controls the frames per second ratio of the animation. It ranges from one frame per second to thirty frames per second. Simply adjust its value until you are content with the speed of the animation. ****************************************************************************************** SAVING A DRAWING/ANIMATION ****************************************************************************************** In order to save a drawing/animation, press the SAVE button located in the lower right hand corner of the interface window. It will bring up a text field in which you can specify the pathname and filename in which you want to save the work you have done. A message box will appear with the name of the file it wrote to confirm that is was done appropriately. ****************************************************************************************** LOADING A DRAWING/ANIMATION ****************************************************************************************** In order to load a drawing/animation, press the LOAD button located in the lower right hand corner of the interface window. This will bring up a file chooser where you can specify the path and name of the previously created scene file. NOTE: Even if you're in the middle of another drawing and you want to load another one, this will work. Loading in a scene erases all currently drawn scenes and animations with the new one.