THIS PAGE IS FOR AN OLD VERSION OF THE COURSE

Course overview. This course is an introduction to 3D computer graphics, covering the mathematical foundations and "modern" OpenGL programming. Topics covered include: linear and affine transformations, homogeneous coordinates, perspective, Phong lighting and Cook-Torrance lighting, interpolation, the Bresenham algorithm, spherical interpolation, hyperbolic interpolation, texture mapping, and Bézier curves. The course grade will be based approximately 50% on exams and quizes and 50% on programming assignments. The first zoom class meeting reviewed a outline of the components of and resources for the course.

Main course meetings are on Zoom, Meeting ID 944 3097 4003.

Password will be in the start-of-the-quarter email and posted to Piazza.

Online textbook and other materials:

Quizzes: General quiz instructions. Please read and understand these ahead of time.
DO NOT DOWNLOAD A QUIZ UNTIL YOU ARE READY TO START WORKING ON IT.
A quiz can be downloaded starting at 6:00am . Please allow sufficient time to upload your quiz answers to gradescope by 10:00:pm.

Textbook: 3D-Computer Graphics: A Mathematical Introduction with OpenGL, by S. Buss (your instructor). A second edition of this book is in preparation, and we will use the second edition, not the first edition. The second edition to the textbook incorporates Modern OpenGL and other updates. The course will cover most of chapters 1 through 8 of the second edition of textbook. Downloadable PDF copies will available to you as they are ready --- see the link above. SO YOU SHOULD NOT PURCHASE THE TEXT BOOK.

Course prerequisites. Math 20C and 18 (Multivariable calculus and Linear Algebra) or Math 31AH. Programming experience. Programming assignments will be in C++ using the Modern OpenGL API. However, the course will not use any advanced features of C++, so experience with any similar language such as C or Java is sufficient preparation. Programming experience in other languages should be fine too. Please discuss it with Professor Buss if you do not have programming experience with any of C, C++ or Java. Occasionally, students without any prior programming experience have successfully taken the course. There is a brief handout describing the basic C++ features needed for 155A available.

Main class time/location: Zoom meetings: Monday, Wednesday, Friday 3:00-3:50pm.

Class schedule as a google calendar: HTML link.

Instructor: Professor Sam Buss
   Office: APM 7456 (rarely used this quarter).
   Email: sbuss@ucsd.edu
   Phone: 442-2877 (personal cell phone, area code 858). Texting is OK, especially to get hold me quickly.
   Office hours: Default office hours (see the calendar above for changes),
      TBA

Teaching Assistants:

   Nicholas Sieger.
      Email: nsieger@ucsd.edu
      Zoom office hours and grading hours:
         Please see the calendar above.
   Ruihan Yang.
      Email: ruy002@ucsd.edu
      Zoom office hours and grading hours:
         Please see the calendar above.

Programming Assignments
   Project 0: Getting Started. Due Friday, October 9, 9:00pm.
      Once you complete the work, hand it in by filling out the form at https://forms.gle/wv9jfUecQYgTFLobA.
   Project 1: Shaded Tents. Due Friday, October 16, 10:00pm.
   Project 2: Solar System. Due Friday, October 23, 10:00pm.
   Project 3: Customized Initial. Due Friday, October 30, 10:00pm.
   Project 4: Surface of rotation and normals. Due Friday, November 13, 10:00pm.
   Project 5: Phong lighting. Due Friday, November 20, 10:00pm.
   Project 6: Texture maps. Due Monday, November 30, 10:00pm.
   Final Project (Project 7): Individual project. Due Saturday, December 12 (or Monday, Decmber 14).
      Hand in projects 1-7 by (a) Turning a PDF file at Gradescope, and (b) Uploading the requested files to a shared google drive folder that will provided to you.

Programming assignments are individual projects. It is RECOMMENDED to get help from other students or other sources including the internet or of course a TA or the professor, but the actual work should be your own. In fact, to foster interaction in this "remote" course, you may be able to receive credit on your programming assignments by reporting that you received help from someone else! However, you should definitely NOT: hand in someone else's code as your own, directly copy code from others, or work too closely with one person for the entire quarter. These will be viewed as serious violations of academic integrity. It is OK however to see someone else's code, and then take a short break (say, three minutes) and then write your own version of the code on your own. If you are not sure what is permitted, please talk with a TA or Professor Buss. (Any help you get from a TA or Professor Buss is permitted of course!)

It is extra important to make an effort to interact with other students, the TA and the professor during this "remote" course. Without this, the course is too isolating. You will want to make an extra effort introduce yourself to other students in zoom meetings, or in piazza discussions. To foster this, it is planned that you can receive credit on your programming assignments by discussing your coding with other students in the class. Please watch for piazza announcements, and class discussions about how this will work.

Handouts
Course components and resources. (From zoom meeting October 2)
Brief introduction to C++ commands needed for the course.
Floating point perils. This is for an old class that did not use Modern OpenGL. Therefore only items 1.-3. in the handout (to the top of second page) are relevant for Programming Project 4.

Mini-midterms and the final exam these will be online. You will have 45 minutes for a midterm and 2 hours for the final exam. Time windows for the midterms and final will be announced.
DO NOT DOWNLOAD A MIDTERM UNTIL YOU ARE READY TO START WORKING ON IT. READ THE INSTRUCTIONS BEFORE DOWNLOADING!

Quizzes. BEFORE YOU TAKE THE FIRST QUIZ: Download the general quiz instructions.
There will short quizzes nearly every Thursday and on some Tuesdays. Topics will be pre-announced. Quizzes will be short, approximately 15 minutes, that will be taken asynchronously online. Quizzes are intended to be low-stakes and easy to study for since they will focussed on pre-announced topics. You should not discuss a quiz with other students until the time window for the quiz has passed.

Computer Labs. With Covid-19, there is no access to computer labs. Most students can use their own PC for programming assignments. The preferred configuation is a Windows 10 system with Visual Studio. However Linus and Macintosh systems may also be used. Some students on Apple systems may find that OpenGL will not work on their system: they can use the Cloudlabs system at cloudlabs.ucsd.edu using "AppStram ECE General Desktop".
Starting with the second project (Project #1), programs will be turned in by uploading (a) a PDF report and (b) source files to a designated google drive location. They will be graded with one-on-one discussions with a TA or Profesor Buss. Detailed instructions will be forthcoming.

Piazza. Please watch piazza for important course announcements. You are strongly encouraged to post questions (and answer questions as well). An example what you might post is a screenshot of your program's output, asking about what the problem might be. However, do not post code from your programming assignment!
If you add the class once the quarter has already started, please email Professor Buss for an invitation to the piazza course page.

Grading: The course grade will be based 50% on programming assignments, and 50% on short quizes, "mini" midterms, and the final. Your lowest midterm score or half of the final exam will be dropped; whichever one helps your grade the most. You can drop your lowest four quiz scores. The midterms and final will be 44% of your grade. The quizes will be 6% of your over course grade.

Other resources

The upgraded course textbook web page has some introductory sample OpenGL programs, along with pages documenting how the code works. These are highly recommended as a way to see examples of how Modern OpenGL is used.

Another excellent source for learning how to use OpenGL is the web pages by Joey De Vries at https://learnopengl.com. These provide both an introduction to OpenGL and discussion of more sophisticated language features. Many other tutorials and resources can be found at https://www.opengl.org. Last, but not least, the Khronos Group leads the development of OpenGL; if you do browser searches for topics in OpenGL, you are likely to find their web pages giving the most official version of the documentation.

Installing OpenGL, with GLEW and GLFW on your own Windows system. You have free use of Visual Studio for use as a UCSD student. In addition, you probably need to install the OpenGL header files and .lib library files, GLFW and GLEW. To obtain these for Windows either see the next paragraph, or download the header files GL/glew.h, GLFW/glfw3.h and the binary static libraries glew3.lib, glew32s.lib, glew32.lib. These need to be installed in your system directory (logging in as an administrator) in the default system include directory for headers and the default system directory for static libraries. You can search for GL/gl.h or GL/glu.h opengl32.lib or glu32.lib to find these system folders. These header and static library files can be obtained online from GLFW and GLEW distribution sites, at http://www.glfw.org/download.html and http://glew.sourceforge.net/.
For other systems, source files and makefiles are available for download to compile yourself.
More info for installing Visual Studio on Windows: The zip file GLEW_GLFW.zip has all the needed files and the instructions given to ACMS to install GLEW and GLFW for the computer lab last year. Similar instructions should work for most Windows 10 machines.
There are other workarounds that can be used for installing GLEW and GLFW for Visual Studio on Windows systems. Please post to piazza if you are having difficulties.
Updated advice for non-windows systems (This is advice from Jonathan Conder in Winter 2018.) On Linux, you can use gcc, and your distribution probably has a package for GLEW and GLFW. On Debian, Mint, Ubuntu etc. they seem to be called libglew-dev and libglfw3-dev. On Arch, they are glew-wayland and glfw-wayland (or glew and glfw-x11 if you're not using Wayland yet). I would recommend using these over compiling stuff yourself. For Mac, you will probably want to program with xcode. There is something called MacPorts, which should make it easier to compile the libraries (and uninstall them when you're done). Visual Studio 2015 (express) also has a built-in package manager called NuGet, which I tried to use but ran into issues (the "glew" package is out of date, so you have to use "glew.v140," but VS doesn't expect packages to have dots in their name so it doesn't let you enable static linking). You might have more luck with an older (or newer) version of VS.
If you install OpenGL with GLEW and GLFW for Linux or Mac please post information on you did it to the piazza course page, so that other students can benefit from it.
Unfortunately, Apple has "deprecated" OpenGL. In principle, OpenGL should still work on all Apple Macintosh systems, but last year a few students were unable to get it to work reliably. If this happens to you, you will need to use Cloudlabs instead.