Remi Gagne - 92995018 - e3a3 CPSC 314 - Graphics Assignment 3 - OpenGL randomness A Simple 3D Lego Scene building tool I am using all three of my grace days for this assignment. As such, it is not late... To compile the program, just type 'make', which will run the included makefile. Note that the program has been tested only under Linux. To run the program, type 'lego' in a shell. From in the program, type 'h' to display a list of supported commands in the shell. There is a simple sample lego scene included; to load it, simply hit F1. Some common terms: Piece - Any type of lego piece; one of Brick, Plate or Slope Brick - A tall, rectangular lego piece. Plate - A flat, rectangular lego piece. Slope - A tall lego piece with one edge sloped downward. Stud - A single bump on the top of a lego piece. Unit - The length or width of a single-stud lego piece. This program meets the requirements for assignment 3 by the following: Camera motion - Use 'a' or 'b' to zoom out or in respectively. - Use the four arrow keys to pan and scan. Complex environment - A scene can become as arbitrarily complex as the user desires, by adding as many lego pieces to the scene as desired. - Lego pieces are not read in from a data file but generated dynamically. However, the scene can be saved / loaded to a file, which meets the import requirement. Texture Mapping - The program uses a single, simple but effective texture, generated at random when the program is launched. This texture is used on the top surface of slope pieces to approximate a subtly bumpy surface. Mouse Interaction - The scene can be rotated about as desired by holding down the middle mouse button and dragging. - Lego pieces can be selected by clicking on them. - The scroll wheel will zoom the scene in and out when turned. - A complex, dynamic, context sensitive popup menu apears when the right button is clicked. Advanced Feature: Picking - Any lego piece in the scene can be picked by simply clicking on it. A picked lego piece will become highlighted by a green wireframe box around it. - Furthermore, multiple lego pieces may be picked in turn by simply holding down the Shift key. Supported Commands: H, h: Display the help menu Q, q, ESC: Exit the program a: Zoom out b: Zoom in <: Decrease the level of rendering detail >: Increase the level of rendering detail w: Toggle wireframe / regular display mode f: Decrease space between pieces g: Increase space between pieces Up arrow: Pan scene Up Down arrow: Pan scene Down Left arrow: Scan scene to the Left Right arrow: Scan scene to the Right Space: Reset the viewport x or 1: Set the viewport directly down the X axis y or 2: Set the viewport directly down the Y axis z or 3: Set the viewport directly down the Z axis F1 - F4: Load the scene saved in the specified slot Shift + F1 - F4: Save the scene to the specified slot To manipulate individual pieces, first click on them to select them. Multiple pieces can be selected by holding Shift and selecting each in turn. Backspace: Delete the currently picked pieces 'r': Rotate the selected pieces by 90 degrees counter clockwise. To move selected pieces around by 1/10 of a unit: Insert: Positive X (right) Delete: Negative X (left) Home: Positive Y (up) End: Negative Y (down) Page up: Negative Z (back) Page dn: Positive Z (forward) Shift + movement key will move selected pieces by one unit. Mouse manipulations: Holding down the middle mouse button and moving the mouse will rotate the scene about the origin, in a simple trackball fashion. The scroll wheel can be turned to zoom the scene in and out. Clicking the left button on a lego piece will select that piece, enabling further manipulation. Holding down Shift while clicking on pieces allows multiple pieces to be selected. Clicking anywhere but on a piece will deselect any selected pieces. Clicking the right button will create a popup menu. This menu is context sensitive; it changes depending on whether a lego piece is currently selected or not. Popup menu: If no brick is selected, the popup men contains options to add either Bricks, Plates or Slopes to the scene. Pieces are added to the scene at the origin. The numbers in the menu correspond to the dimensions of each piece to add. If a brick is selected, in addition to the piece add menu options, there are also options to manipulate the currently selected bricks, including changing their colour and rotating them. Saving and Loading: There are four scene save files: scene1.lgo - scene4.lgo. To save a scene to any slot, use Shift+F1 - Shift+F4, where Fx matches the number of the scene you would like to save to. To load a saved scene, use F1 - F4, where Fx matches the number of the scene you would like to save to.