Intro/Programming in C
Total Page:16
File Type:pdf, Size:1020Kb
Computer Graphics 1 CIS 250 Syllabus Winter Quarter 2006
Donald D. Derkacht CIS 250A, COMPUTER GRAPHICS 1, 5 Credits Monday, Wednesday and Friday; 3:00 – 4:25 PM AAR123
Computer Graphics 1 (CIS 250) CIS 250 offers an introduction to three-dimensional computer graphics and the design and implementation of graphical software. Software shall be implemented in the context of a modern graphics API, such as Direct3D, OpenGL or the Visualization Toolkit; and a .NET programming language, such as C++ or C#. Actual API and programming language choice shall be at the discretion of the instructor and not necessarily limited to those listed. Prerequisites: CIS 280 and MATH 112, or instructor’s permission. Prerequisites: CIS 280 and MATH 112 or instructor’s permission
General Comments : This syllabus is a general guide to CIS 250A for winter quarter and I reserve the right to make changes, adjustments and correct mistakes. This shall be a great class. Concerning the agenda before us, we might consider carefully the words of the poet:
“The heights of great men [and women] reached and kept, were not obtained by sudden flight, But they while their companions slept, were toiling upward in the night.”
Henry Wadsworth Longfellow (1807 – 1882)
Instructor Information: The following table shows some basic instructor information.
Instructor Donald D. Derkacht Department Business (CIS) Office Vocational Building, Room 102 Telephone (360) 442-2723 email [email protected]
1 The following table shows my schedule for winter quarter, 2006.
Monday Wednesday Friday 9:30 – 11:10 Office Hours Office Hours Office Hours 11:10 – 12:50 CIS 180A CIS 180A CIS 180A 1:20 – 2:45 CIS 285A CIS 285A CIS 285A 3:00 – 4:25 CIS 250A CIS 250A CIS 250A
Tuesday Thursday
Please note: if you need help during office hours, but for whatever reason cannot meet during those times, then please schedule an appointment. You may also come for help at any time. If the door is shut and it is outside of office hours, then I am either not there or in a time bind. But office hours are the best time.
The Class Text: There are two required class texts. The first one is titled Beginning C# Game Programming by Ron Penton. The second text is titled Managed DirectX 9 Graphics and Game Programming by Tom Miller. The third text is optional, and is titled Introduction to 3D Game Programming with DirectX 9.0. I would recommend all to purchase this text. It was difficult to find suitable texts for this course. I managed to keep the price fairly inexpensive per book.
Course Description: Offers an introduction to graphics and game programming, using C# as our programming language and DirectX 9.0 for our graphics API (Application Programmers’ Interface).
Communication: Communication, written as well as spoken, is one of the premier skills. Part of a robust problem solving methodology and well conceived design spring from neatness and organization. Disorganized work is too often a symptom of equally disorganized thoughts. Programming and text assignments, etc., that show inadequate levels of organization will not fare as well as work that is well done. Please do not give to me to grade an assignment whose pages have been ripped from a spiral binder. Do not dog ear your work; instead use a stapler. Commit to a uniform paper size. Identify each assignment with your name, what the class is, what the assignment is and the date. I will provide sample documentation for a program so that each student will know what I expect concerning this.
Academic Integrity: Work submitted by a student should reflect his or her own thought and intellectual property. All other work should be cited. The following should be avoided: cheating, which is willfully using or attempting to use in the pursuit of any academic exercise materials, study aids, information, computational devices, etc., that have not been authorized by an instructor; fabrication, which is the willful or
2 unauthorized falsification or invention of any data and information, citation or document or lying during an investigation concerning cheating, fabrication or plagiarism; plagiarism, which is willfully representing the words, thoughts and intellectual property of another as one’s own. Under United States copyright law, any document that is created, such as a mathematics assignment or computer program is automatically protected by copyright. Any student copying the assignments of other will be in violation of the copyright.
Minimizing Classroom Disruptions: During the lecture and lab time slots, please deactivate cellular telephones and pagers. During the lecture, please listen quietly, both to myself and others when given an opportunity to move forward the class agenda. Please do not engage in private, autonomous conversations during the lecture. This is very disruptive, especially when the subject of the day is programming.
Individual logins: Please note well the following information concerning access to the computers in the Instructional Computing Center. Beginning fall quarter all students will be required to enter individual logins to use computers in the Instructional Computing Center. To obtain their login information, students will need to bring their LCC student photo ID cards to the Help Desk in Lab 2 (AAR 110). No login information will be given without photo ID. They will be given their logins and passwords by the lab assistants, Cindy, or me. This change coincides with an upgrade to Windows XP and Office XP.
Once logged in, students will be able to save their work in their own My Documents folders.
Please remind your students that if they wish to use the LCC lab computers, they must obtain their login information prior to doing so. The generic logins have been disabled.
Warning: do not rely on the system to archive your work. You are responsible for provide the documentation for each assignment in a timely fashion; viz., on the due date. If the system loses your work, that is your problem and not mine. Archive it on a Zip or floppy disk. If you lose your work, then redo it. It is easier to archive however. Ultimately, each student should archive using hardcopy. Each student should provide a hardcopy for me as well as a reserve hardcopy held in each students’ archive.
Class Work: Various kinds of assignments and tests comprise the graded material of this course. These are detailed in the following table.
Tests: There are two tests, a mid-term and a final examination. Each examination will be comprehensive and may cover material from the text, programming assignments, lectures and any collateral material. Tests will emphasize programming and there may be questions of other types as well, such as true/false, multiple choice, essay, etc. The mid-term will be given shortly before mid-term grades are due. The final examination will be given according to the LCC published final examination schedule. Text Assignments: Self-test questions may be found throughout each chapter in the class text. Each student is expected to work those that are assigned as part of the course work. These problems may involve programming, but are usually general knowledge type questions. I will not collect text assignments for a grade. However, each student should make every effort to work the problems to gain a deeper
3 knowledge of the subject. The tests may well, to a certain degree, reflect the question assigned. Be sure to check your work for the self-test questions against the answers provided at the end of each chapter. General Note: The article review, the quizzes and the programming assignments each carry the same value. E.g., if 10 programming assignments, 5 quizzes and the single review article are collected by the end of the quarter, then together these form half of each student’s grade and each assignment carries the same value. So, for this example, each would be worth a total of 50 (out of 100)/16 = 3.125 points. The programming project will count as at least three programming assignments.
Also, I will not accept any handwritten documentation for programming assignments, quizzes or the article review. I expect professional documentation: this includes grammar, spelling, organization, clarity and so forth. For the mid-term and the final, handwritten work is acceptable, but it must be neat. Article Review: A single article review is due by mid-term. These may be based on any article that you find in the area of computer science. The review must be at least two pages in length and include a copy of the article being reviewed. Quizzes: Quizzes may be unannounced or scheduled. These are usually programming oriented but also may cover general knowledge. If a quiz is given during the lecture, these cannot be made up. A programming quiz can be. It is the students’ responsibility to track all assignments, including quizzes, and make sure they are completed. Programming Assignments: Along with the examinations, programming assignments form the bulk of the class work. There will be at least five such assignments and these should reflect each student’s individual work. Programming assignments will be partly graded in the lab. In the lab I will determine if the program being submitted for a grade functions correctly, and has a well designed user interface. At this time, the documentation for the particular assignment must be ready, as I will collect the documentation and mark it with the partial grade concerning correctness and interface. The overall grade will also depend on the quality of documentation, which should include a hard copy of the source code properly commented and any other material. Also, when programming assignments for certain weeks are very short, more than one programming assignment will be given. See the sample program to understand the format I expect when grading your programming assignments. This sample is part of this syllabus. Your documentation should follow the structure of the sample documentation that I provide, include the grading table on the last page. I will not accept programming assignments on disk and I must see them work in the lab- no exceptions.
Also, please note especially well: I allow lab time during the class time slot to work on programming assignments. However, this lab time, in part, may be spent on lab quizzes, with any time left to be devoted to programming projects. Lab quizzes cannot be made up. It is during this lab time I grade, concerning execution and interface clarity, programming assignments. This time is also provided for each of you to work on your programming assignments and receive help from me, and others, if needed. However, there is not sufficient time during lab for most people to finish their programming assignments. I expect each of you to use time outside of class to complete these
4 assignments. I expect that at least eight to ten hours per week outside of class is needed to complete the assignments. You may either use your own computer and those available in the labs. Start early. Then if you run into problems there will be sufficient time to seek help and thinking space. Late Work: Work that is late will be accepted under prior arrangement. If, for example, you are sick, let me know and I will accept the work when you are well and back on campus. Please do not miss tests unless you have a sickness that can be spread to others. Wait until you are well. Work that is late due to something other than sickness or family emergency may be penalized. Also, note well: I do not like to give tests to individuals who cannot take the mid-term or the final during the assigned time slot. However, under extremely extenuating circumstances (illness and so forth), I may consider allowing a student to complete the midterm on a different day than the one selected for the test. However, do not expect this test to be the same as that taken by the class. It will not be, and may even be more difficult, as I have a limited amount of time and do not like to spend it writing multiple tests. For me to give the same test outside the allotted time slot to an individual student would violate the integrity of my examinations.
You may mind storm together when working on the various assignments, except for tests, but make sure that you complete work that is original and is uniquely yours. If you rely on help to understand a difficult concept, re-forge it on the anvil of your own thinking and make the material your own. Do not copy the work of others.
Grading: The following table shows how the various categories of assignments are graded. Note that text assignments are not graded, but it is expected that each student will study and solve the assigned problems to facilitate understanding of the text concepts.
Type of Assignment Weight Text Assignments (Not graded). 0 Programming Assignments, Quizzes and Article Review 50 Mid-term Examination (emphasis on programming) 25 Final Examination (emphasis on programming) 25 Total: 100 points
I reserve the right to change weights as I see fit. Grades are assigned according to the following table. Let x be a grade as a percentage.
Percentage Grade Letter Grade 95 <= x <= 100 A 90 <= x < 95 A- 86 <= x < 90 B+ 83 <= x < 86 B 80 <= x < 83 B- 76 <= x < 80 C+ 73 <= x < 76 C
5 70 <= x < 73 C- 66 <= x < 70 D+ 63 <= x < 66 D 60 <= x < 63 D- 0 <= x < 60 F
Assignments: The following assignments reflect the anticipated goals for this course. Unless otherwise noted, the various assignments are due seven days from when they are assigned. We will follow this schedule regardless of holidays. If a holiday marks the day an assignment is assigned, then it is each student’s responsibility to begin work. If an assignment is due on a holiday, then I will accept it the next class meeting after the holiday. Again, for programming assignments, I grade the correctness of output and the quality of the user interface in the lab and take the documentation with me to complete the grading in my office. I do not want disks and I do not want to take the time to run software in my office. I also do not want my office computer exposed to viruses. That is one of the reasons why I do this. If I do not see each student’s code run in the lab, the highest grade than can be obtained is 50% for that programming assignment.
Note well: If you find the following assignments to easy, please ask for a more challenging set. To maintain equity, the more challenging set of programming projects consists of half the number of programming projects in the tables below. There is not a more challenging project for week one though.
Note well: We do not have much time to waste. I do expect that all students already know how to program, at least at the level of CIS 180 and have an ability with programming as well. There will be one, or possibly two, programming project(s) per week. There may be an occasional programming quiz to help clarify concepts. The first four weeks will be spent learning a good portion of C#, at least enough to allow us to write some beautiful graphical applications.
Assignment – Week One Problems/Location Pages Discuss syllabus In class Student academic biography In class
Read chapter one: Beginning C# Game 3 – 12 Programming. Chapter one: Review Questions Questions 1.1 – 1.4 11
Read chapter two: Beginning C# Game 13 - 34 Programming. Chapter two: Review Questions Question 2.1 – 2.19 32 - 34
Programming Assignment One: See below Not applicable Programming Assignment Two: See below. Not applicable. Programming Assignment One: Write a Hello World program in C# as a console application. Use VisualStudio to write the program..
6
Programming Assignment Two: Consider the lone man, now making his way from a barn in much need of repair to a place on his farm where he hopes to build a corral. He has many mean horses that need a secure place to roam. This farmer also has not had too many good and prosperous years, and so has little money for his fence, which must consist of a single strand of wire (he can add and electric fencer to make the horses respect the fence). To reduce the cost of his fence, he will build it at a place on his property where two rock walls meet at right angles. The fence will be rectangular. Two of the rock walls shall form two sides of the fence. The wire shall form the other two sides. There will be no gate. Consider the following diagram.
The very dark line represents the rock wall. The fainter lines represent some of the many fences the farm could place using his fixed length piece of wire. Write a computer program in C# (a console application) to ask the user for a length of wire. The program should then figure out how wide and long to make the corral to enclose as much area as possible. There should be a user loop to allow the user to run the program as many times as he or she wishes. Also, the program should make use of iteration (a loop) to solve this problem.
Consider the following data, which assumes that the piece of wire is 100 feet long:
Coral Length Coral Width Area Enclosed 1 foot 99 feet 99 square feet 2 98 196 square feet
7 5 feet 95 feet 475 square feet 30 feet 70 feet 2100 square feet 80 feet 20 feet 1600 square feet 90 feet 10 feet 900 square feet 99 feet 1 99 square feet In all cases, the length + width = length of the wire, right? What must the length and width of the corral be to enclose the most area for the fixed length of wire? Remember, the horses are mean and want to have as much grass to eat as possible.
Assignment – Week Two Problems/Location Pages Read chapter three: Beginning C# Game 35 - 61 Programming.
Chapter three: Review Questions Questions: 3.1 – 3.19 59 - 61
Programming Assignment Three See below Not Applicable.
Programming Assignment Three: See my instructor’s page.
Assignment – Week Three Problems/Location Pages Read chapter four: Beginning C# Game 62 - 86 Programming.
Chapter four: Review Questions Questions: 4.1 – 4.14 85 - 86 Ch 3, Pro. Proj. 3 156 Programming Assignment Four See below Not Applicable.
Programming Assignment Four: See my instructor’s page.
Assignment – Week Four Problems/Location Pages Read chapter four: Beginning C# Game 87 - 120 Programming.
Chapter five: Review Questions Questions: 5.1 – 5.18 118 - 119
Programming Assignment Five See below Not Applicable. Programming Assignment Five: See my instructor’s page.
Assignment – Week Five Problems/Location Pages See Instructors’ Page
8 Assignment – Week Six Problems/Location Pages See Instructors’ Page
Assignment – Week Seven Problems/Location Pages See Instructors’ Page
Assignment – Week Eight Problems/Location Pages See Instructors’ Page
Programming Project: See Instructors’ Page
Programming Project : is worth four programming assignments - This is due at the latest during the last day of lecture. This shall be your large programming project. Each of you are to implement the same program, which shall be a game and I shall grade it concerning correctness of execution and clarity of interface in the lab, at the latest, the last day of lecture. I will not accept this project after this date. Also, I will expect professional documentation for this project, just as for all the other programming assignments. This I will collect on the day that I grade this project in the lab. You may start this project sooner than week eight if you wish, and I suggest that you do so. Also, this project shall be worth four programming projects in value.
Programming Project: write a three dimensional computer game. See Instructors’ Page for further details. I will also provide the option where each student can create and implement his or her own 3D computer game, but a proposal must be submitted to the instructor and the intended game must be as complex, if not more so, than the one to be discussed on the Instructors’ Page.
Assignment – Week Nine Problems/Location Pages See Instructors’ Page
9 Enabling Objectives: the following table lists the enabling objective for CIS 250. The student will be able to do the following:
Write programs utilizing the class concept, branching, iteration, arrays, and so forth to achieve an introduction to the selected programming language. Explain the functionality of the selected graphics API. Explain how the graphics pipeline functions. Explain various concepts from computer graphics, include the concept of a vertex, textures, and so forth. Write graphics programs using the selected programming language and graphics API.
10