4 Pages

DisplayLists

Course: EECS 4530, Fall 2008
School: Toledo
Rating:
 
 
 
 
 

Word Count: 602

Document Preview

Lists Display and Transformations September 16, 2002 n What is a Display List? w Something like a subroutine. Rather than repeatedly put in primitives for an object it will allow you to reuse them. Cannot pass parameters to a display list Two steps, compile and call. n n Why use a Display List? w Efficiency n Compiling a Display List glNewList (BOX, GL_COMPILE); (BOX must be a unique identifier) glBegin...

Register Now

Unformatted Document Excerpt

Coursehero >> Ohio >> Toledo >> EECS 4530

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Lists Display and Transformations September 16, 2002 n What is a Display List? w Something like a subroutine. Rather than repeatedly put in primitives for an object it will allow you to reuse them. Cannot pass parameters to a display list Two steps, compile and call. n n Why use a Display List? w Efficiency n Compiling a Display List glNewList (BOX, GL_COMPILE); (BOX must be a unique identifier) glBegin (insert primitives and attribute calls) glEnd() glEndList(); It is often possible to to gain speed/space advantages A simple change of a display list will change all occurences of the display list Can be transformed and reused multiple times. w Ease of changee n w Reusability n Using a Display List w glCallList(listID); Often want to isolate a display lists effects: glPushMatrix(); glPushAttrib(GL_ALL_ATTRIB_BITS); glCallList(); glPopAttrib(); glPopMatrix(); A Bigger Example #include "glut.h" #include <cmath> #include <iostream> using namespace std; void init(); void display(); void menuHandler(int); static int cubeID, sphereID, tetrahedronID, icosahedronID, currentID; 1 Main Program int main (int argCount, char *argValues[]) { int menuID; glutInit (&argCount, argValues); glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (400, 400); glutInitWindowPosition (100, 100); glutCreateWindow (argValues[0]); init(); glutDisplayFunc (display); } main (contd) /* * Build a simple menu */ menuID = glutCreateMenu(menuHandler); glutAddMenuEntry("Cubes", 1); glutAddMenuEntry("Tetrahedron", 2); glutAddMenuEntry("Sphere", 3); glutAddMenuEntry("Isocahedron", 4); glutAddMenuEntry("Exit", 5); glutAttachMenu (GLUT_RIGHT_BUTTON); glutMainLoop ( ); return EXIT_SUCCESS; init() void init() { glClearColor(0.0, 0.0, 0.0, 0.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-3.0, 3.0, -3.0, 3.0, -10.0, 10.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); /* * It doesn't have to be done here but I'm going * to set up the displayLists at this point. */ init (contd) cubeID = glGenLists(1); // Draw the cube glNewList(cubeID, GL_COMPILE); glBegin (GL_POLYGON); glVertex3f (-0.5, -0.5, 0.5); glVertex3f ( 0.5, -0.5, 0.5); glVertex3f ( 0.5, 0.5, 0.5); glVertex3f (-0.5, 0.5, 0.5); glEnd(); glBegin (GL_POLYGON); glVertex3f (-0.5, -0.5, -0.5); glVertex3f ( 0.5, -0.5, -0.5); glVertex3f ( 0.5, 0.5, -0.5); glVertex3f (-0.5, 0.5, -0.5); glEnd(); init (contd) glBegin(GL_POLYGON); glVertex3f glVertex3f (-0.5, (-0.5, glVertex3f (-0.5, glVertex3f (-0.5, glEnd(); glBegin(GL_POLYGON); glVertex3f ( 0.5, glVertex3f ( 0.5, glVertex3f ( 0.5, glVertex3f ( 0.5, glEnd(); -0.5, -0.5); 0.5, -0.5); 0.5, 0.5); -0.5, 0.5); init (contd) glBegin(GL_POLYGON); glVertex3f ( -0.5, 0.5, glVertex3f ( 0.5, 0.5, glVertex3f ( 0.5, 0.5, glVertex3f ( -0.5, 0.5, glEnd(); glBegin(GL_POLYGON); glVertex3f ( -0.5,-0.5, glVertex3f ( 0.5,-0.5, glVertex3f ( 0.5,-0.5, glVertex3f ( -0.5,-0.5, glEnd(); glEndList(); -0.5); -0.5); 0.5); 0.5); -0.5, -0.5); 0.5, -0.5); 0.5, 0.5); -0.5, 0.5); -0.5); -0.5); 0.5); 0.5); 2 init (contd) sphereID = glGenLists(1); // Draw a sphere. glNewList(sphereID, GL_COMPILE); glutWireSphere(0.5, 10, 10); glEndList(); tetrahedronID = glGenLists(1);// Draw a tetrahedron glNewList(tetrahedronID, GL_COMPILE); glutWireTetrahedron(); glEndList(); init (contd) icosahedronID = glGenLists(1); glNewList(icosahedronID, GL_COMPILE); glutWireIcosahedron(); glEndList(); currentID = cubeID; } display void display (void) { float xoffset, yoffset, zoffset; glClear(GL_COLOR_BUFFER_BIT); for (xoffset = -2.0; xoffset < 3.0; xoffset += 4.0) { for (yoffset = -2.0; yoffset < 3.0; yoffset += 4.0) { for (zoffset = -2.0; zoffset < 3.0; zoffset += 4) { glPushMatrix(); glTranslatef(xoffset,yoffset, zoffset); glCallList(currentID); glPopMatrix(); } } } glFlush(); } menuHandler void menuHandler(int itemPicked) { /* * Simple handler that changes color being drawn with. */ switch (itemPi...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Toledo - EECS - 4530
Basics Monday December 13, 2004Computer GraphicsDecember 5, 20045:00-7:00 PM Open Book and Notes Lots of (hopefully shorter) questions. ComprehensiveGreen Book Chapters 1, 2, 4, 5, 6, 7, 8, 9, 11, 14 Chapter 3.1-3.4, 3.14, 3.16-3.17, 3.23-3
Toledo - EECS - 4530
Characteristics Input and GLUTs CallbacksEECS 4530: Computer Graphics I September 9, 2002nn n nAll the GLUT supported I/O routines use callbacks to return information to the program. This type of input would be known as event mode input. Reques
Toledo - EECS - 4530
This Example More Primitives &amp; AttributesSeptember 1, 2004 We will try to do a fair amount with a very simple basic object a box. The width, depth, height, and position of the box can be specified. We will also look at how to &quot;move around&quot; the b
Toledo - EECS - 4530
Laboratory 1 Computer Graphics I Getting Started with GLUT and OpenGLFall 2006 Purpose of Lab: The purpose of this lab is to get you to a point where you can compile and run OpenGL programs on the University systems The instructions are for the Sun
Toledo - EECS - 4530
Problem 1 Textures in OpenGL are attached to a surface using texture coordinates. Given the following texture give the texture coordinates to apply it to the polygon shoen to achieve the shading shown assuming we are using GL_REPLACE mode. Assuming
Toledo - EECS - 4530
Modeling Complex Objects It is necessary to link or group pieces together into an object at times. An example of this would be a human limb. You rotate your shoulder and the arm rotates as wellComputer GraphicsHierarchies of Objects September 19
Toledo - EECS - 4530
Orthographic ProjectionsComputer Graphics I September 12, 2005 Ignores the Z direction No perspective (distance makes no difference) Common in many types of Engineering drawing.How do we change the plane?Could change around the coordinates and dr
Toledo - EECS - 4530
Animation Techniques Flocking and Particle SystemsComputer GraphicsSeptember 28, 2005 We often need to have a group of objects but do not want to script or write the exact motion of the object. Originally occurred with the idea of flocking bird
Toledo - EECS - 4530
Syllabus EECS 4530: Computer GraphicsCatalog Description: 4 hours. Prerequisite: EECS 1500 or EECS 1530. An introduction to typical computer graphics systems and their operation. Supporting software will be generally discussed with examples given fr
Toledo - EECS - 4530
Note These slides were not actually used in class but do contain the information that we went over. I'm using them to summarize what we did go over.Computer GraphicsAugust 31, 2005Topics Compiling an application under Microsoft Windows using G
Toledo - EECS - 4530
To Run GLUT and OpenGL Using Borland1. Copy the glut32.dll and glut.h files down from the links page on the class website (http:/ /www.eecs.utoledo.edu/~jheuring/eecs4530.html) to the directory your project will be in. Open a Command or MS-DOS Windo
Toledo - EECS - 4530
Computer Graphics: Vector Operations &amp; Object RepresentationSeptember 20, 2004OpenGL Vertex Arrays Rather than calling glVertex for each vertex we can use a more powerful method.Steps1. Enable the vertex processingglEnableClientState(GL_VERTE
Toledo - EECS - 4530
Test Coverage Red Book Chapter 2 State Management and Drawing Geometric Objects Primitives, normals, vertex arraysComputer GraphicsOctober 10, 2005 Chapter 3 Viewing Projection Transforms Viewing and modeling transforms Matrix Stacks C
Toledo - EECS - 4530
Test 1 Results Computer Graphics High Low Median Average 97 50's 82 78Test 1 ResultsCurrent Project A routine and class for NFF files is available on the Web Site It reads the format as specified.100 90 80Series1S c o re70 60 50 0 5
Toledo - EECS - 4530
Test Info Computer GraphicsDecember 9, 2002Monday December 16 5-7PM Here (PL 3100) Open book and notes Comprehensive but will include Discrete Techniques (Ch. 7) Particle Systems (Ch. 11.3)Some more B-Spline InfoWhy are there knots? And why more
Toledo - EECS - 4530
Computer GraphicsMore on InputlWe mentioned 3 modes last time Sample Event RequestSeptember 11, 2002Types of InputlPicks and Locations in OpenGLl lGenerally broken into 6 types locatorl l l l l lbrings back a location or
Toledo - EECS - 4530
Getting Started With OpenGLPrimitivesOpenGL supports a number of primitives that include: Points (GL_POINTS) Lines (GL_LINES), Line Strips or Polylines (GL_LINE_STRIP), and Line Loops (GL_LINELOOP) Triangles (GL_TRIANGLES), Triangle Strips (G
Toledo - EECS - 4530
What is an Attribute Primitives and AttributesSeptember 4, 2002nAn attribute changes the appearance of a primitive.n n n n nColor Line type (dotted, dashed, etc.) Line width filled or unfilled (polygon) italic, bold, or plain (text)Changing
Toledo - EECS - 052005
cone 10.0 0.0 10.0 2.0 10.0cylinder -10.0 0.0 10.0 2.0 10.0sphere -10.0 0.0 -10.0 3.0sphere 10.0 0.0 -10.0 3.0cylinder 100.0 0.0 0.0 3.0 10.0cylinder -100.0 0.0 0.0 3.0 10.0cylinder 0.0 0.0 100.0 3.0 10.0cylinder 0.0 0.0 -100.0 3.0 10.0
Toledo - EECS - 2000
Ethics Report - PrivacyTopics: Spam Free Speech or Invasion of Privacy? Is Online Speech Protected as Free Speech? RFID's and Privacy Is it Much Ado About Nothing? Satellite Photos Is Somebody Watching? GuidelinesAgain, 3-5 pages double
Toledo - EECS - 2000
Company ReportAssigned CompaniesIntel General Electric Hewlett-Packard Sun Microsystems Keithley Instruments First Energy Corporation IBM EE/CE/CS EE/CE EE/CE/CS CE/CS EE/CE EE/CE/CS EE/CE/CSReport GuidelinesShould be about 3-5 pages double spac
Toledo - EECS - 1570
Take a Grammar and Generate StringsProject 5March 31, 2005 Depending on the underlying complexity of the grammar this could generate some very convincing text. (Of course parts may be pure garbage as well)Derivations Using the grammar on the
Toledo - EECS - 1570
Some Changes Sorted Lists Array BasedEECS 1570 Spring 2005 Adds and Deletes must be done differently than in our unsorted version Searches can be done more efficiently Most of the rest is unchanged.Add An add is going to take a couple of step
Toledo - EECS - 1570
Big O notation As mentioned earlier we rate algorithms and data structures on their running time. Normally depends on the number of items in the structure. Common Operations: Adding Searching DeletingOrder of OperationsEECS 1570: Linear Data
Toledo - EECS - 1570
Merge SortAlgorithmTo do the merge we will split it into 3 cases. Two easy cases:If the first list is empty you just need to copy the second list over to the new, sorted list. If the second list is empty you just need to copy the first list
Toledo - EECS - 4980
JavaApril 7, 2003Tip of The Day Dialog Boxes Often one wants to put up a dialog box that must be completed before continuing. JOptionPane class in Swing provides this functionality Different Types of Dialogs are SupportedA Quick Sampleimpor
Toledo - EECS - 1570
&lt;sound bite&gt;&lt;sound bite&gt; &lt;catch phrase&gt; &lt;vague platitude&gt; &quot; You're no &quot; &lt;impressive person&gt; &quot;!&quot;&lt;catch phrase&gt; &quot;Read my lips: &quot;&lt;catch phrase&gt; &quot;As &quot; &lt;impressive person&gt; &quot; always said: &quot;&lt;vague platitude&gt; &quot;no taxes! &quot;&lt;vague platitude&gt; &quot;nuke &quot; &lt;some
Toledo - EECS - 1570
Test GroupThis is a test group for the fourth project to checkif the read functions workTest Message 1IshmaelWed Mar 09 15:15:59 EST 2005Hey mjan, I just got a job on a ship out of Nantucket!Cool! Ishy Bill Wed Mar 09 16:15:43 EST 2005
Toledo - EECS - 1570
The Doubly-Linked ListAdding before the current element.Double Linked ListcurrentMarch 17, 2005DoubleLinkElement newElement = new DoubleLinkElement( ); newElement.setNext(current); newElement.setPrevious(current.getPrevious( ); current.setPre
Toledo - EECS - 1570
Definitions Hash Function A function used to manipulate the key of an element in a list to identify its location in the list. This can be as simple as picking the first letter of a string, the last two digits of a year, or some such value. A good
Toledo - EECS - 1570
Project 3 Linear Data Structures Say Cheese! Due: March 3, 2005Description:In this project you are going to design and implement a program to guide the new RC4000 robotic mouse through a maze to find a hunk of virtual cheese. The mouse can move n
Toledo - EECS - 1570
EECS 1570: Linear Data Structures - Project 1 : Automated Menu Due: Thursday January 27, 2005Background This project is meant for you to brush up your programming skills and possibly use some of the Java programming techniques that are discussing in
Toledo - EECS - 1570
Links Lab Linear Data StructuresGoalIn todays lab we will try construct a set of routines for a stack and a queue using linked structures.Procedure:Two completed classes and two skeletons are available for download from the class website at htt
Toledo - EECS - 1570
Course Timetable EECS 1570: Linear Data StructuresThis timetable is only a guess as to the timing and ordering of topics and may change during the term. As projects are distributed in class and prior to the midterm we will verify the dates in class.
Toledo - EECS - 1570
Automated Text Generator Project 5 Linear Data Structures Due: April 19, 2005DescriptionIn this project you will write a program that will input a grammar that describes a system of productions (a grammar) that will generate a story, a joke, or an
Toledo - EECS - 1570
Project1 Graded out of 125 points Most common problem menu only printed at start of program. Other problems: Items on menu. We specified 200 in class with possibly 10 choices or 5 sizes. Read the file but don't use it Missing pieces (like orde
Toledo - EECS - 1570
Thursday's ClassTest 1 Example Questions &amp; ReviewLinear Data Structures Spring 2005 We will meet in the Sun lab (NE 1026) on Thursday from 2:00-3:15. The lab will go through linked structures for stacks and queues. If you need to attend the Job
Toledo - EECS - 1570
Test 1 Answers ResultsHigh Average Median 94 78 81Spring 2005 Linear Data StructuresProject 2 StatsQuestion 1public double occupancy( ) { int i, occupied; occupied = 0; for (i = 0; i &lt; values.length; i+) { if (values[i] != null) { occup
Toledo - EECS - 1570
Reading Information in Java Software EngineeringEECS 1570 Spring 2005 In Java, assume we want to read from the console. You should probably create a BufferedReader to allow you to read lines. In Java, the Buffered Reader reads lines well but doesn't
Toledo - EECS - 1570
HeapsText DefinitionThe heap is a complete binary tree where each elements value is greater than the values of each of its children.All Sorts of SortsApril 7, 2005Now, all I have to do is define children, binary tree, complete binary tree, etc
Toledo - EECS - 1570
MenuItemimport java.io.BufferedReader; import java.io.IOException; /* * @author Jerry Heuring * Created on January 7, 2005 * * This is a base class representing a simple menu item. This * version will use inheritance to handle the refinements for *
Toledo - EECS - 1570
JFrames GUI's and Java A Quick IntroEECS 1570 Spring 2005 A JFrame is the basis of almost any GUI. Can have an instance variable that is a JFrame or you can extend the JFrame class. There are times when each is of value.JFrame Basics JFrames a
Toledo - EECS - 1570
Project 1 DiscussionQuestions? Sizes? I told you that you could use arrays but I didn't give you any maximum numbers of items they needed to hold. Menu items : 200 maximum Options (no cost) : 10 maximum Sizes (different costs) : 5 maximumProject 1
Toledo - EECS - 1570
Lab Hours Dynamic ArraysEECS 1570 Linear Data Structures Fall 2005 Friday 1/21/2005 Monday 1/24/2005 Tuesday 1/25/2005 Wednesday 1/26/20052:00-4:00 PM 1:00-3:00 PM 3:30-5:30 PM 9:00-10:00 AM 1:00- 3:00 PMLab: NI 1072Normal Steps in Maki
Toledo - EECS - 1570
We Can Use Recursion to Do BacktrackingRecursion - ContinuedMarch 29, 2005 Our backtracking in the maze earlier, we can use recursion to do the same thing without an (explicit) stack. The actual layout of the program may not change much.Some
Toledo - CSET - 3150
Algorithm sC ET 3150 SAlgorithm sTopics De finition of an Algorithm AlgorithmExam s ple S yntax ve S m rsus e antics Re ading C ourseWe page b sProble S m olvingProble solving is theproce of transform the m ss ing de scription of a proble int
Toledo - MATH - 1330
Each quiz is worth 9 points. Quiz 30 Dec 10 Find the exact value of: 1. tan -1 ( - 1 ) 2. Arc tan 3 3. tan -1 0 Scores: 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0 Quiz 29 Dec 8 Find the exact value of: 2 3 -1 1. c
Toledo - MATH - 1850
MATH-1850 Exam 2 Summer 2001Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers are to be exa
Toledo - MATH - 1850
Quizzes Given Fall 2006 Quiz 41 December 5 From a point on the ground, which is 100 feet from the base of a building, the angle of elevation to the top of the building is measured to be 60 with a possible error of 1. a. Find the approximate error in
Toledo - MATH - 1850
MATH-1850 Quiz Scores as of October 23 Grade Summary Sheet: These scores are the result of Quiz 1 through Quiz 15. Each quiz is worth 9 points. After dropping the four lowest quiz scores, there is a maximum of 99 points. As of October 16, the class h
Toledo - MATH - 1850
Quizzes Given Spring 2007 Quiz 42 April 23 2 Evaluate (cos + 5 csc ) d Quiz 41 April 20 Evaluate 2 5 u3 (3u5-+ 6) duQuiz 40 April 19 From a point on the ground, which is 40 yards from the base of a building, the angle of elevation to t
Toledo - MATH - 1850
MATH-1850 Quiz Scores as of November 25 Grade Summary Sheet:These scores are the result of Quiz 1 through Quiz 27. Each quiz is worth 9 points. After dropping the four lowest quiz scores, there is a maximum of 207 points. As of November 20, the clas
Toledo - MATH - 1850
MATH-1850 Final Quiz Scores: These scores are the result of Quiz 1 through Quiz 33. Each quiz is worth 9 points. After dropping the four lowest quiz scores, there is a maximum of 261 points. As of the last day of class, the class met 29 days for a to
Toledo - MATH - 1850
MATH-1850 Exam 3 Fall 2005Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers are to be exact
Toledo - MATH - 1850
MATH-1850 Exam 3 Spring 2005Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers are to be exa
Toledo - MATH - 1850
MATH-1850 Exam 3 Fall 2004Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers are to be exact
Toledo - MATH - 1850
MATH-1850 Exam 3 Summer 2001Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers are to be exa
Toledo - MATH - 1850
MATH-1850 Exam 3 Form A Fall 2001Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers are to b
Toledo - MATH - 1850
MATH-1850 Exam 3 Spring 2004Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers are to be exa
Toledo - MATH - 1850
MATH-1850 Exam 1 Fall 2000Name _SOLUTIONS_ S.I.D.# _INSTRUCTIONS: You must show enough work to justify your answer on ALL problems. Correct answers with no work (or inconsistent work) shown will not receive any credit. All answers must be exact.
Toledo - MATH - 1850
10.A rectangle is inscribed in an isosceles triangle whose base is 48 feet and sides are 30 feet. If two of the vertices of the rectangle lie on the base of the triangle, then express the area of the rectangle as a function of one variable.3030