John Brosz's 453 Web Site

Labs: B03 (TR 1700), B04 (TR 1600) in the undergraduate graphics lab.

Contact: brosz at
Office: None, email me and I'll meet you in the ug graphics lab.

Check out the RAYTRACING PICTURES. Nice work everyone!

What's Up

  • Your assignments are all marked. Yea! Hopefully you're all as happy as I am about that. Anyways if you haven't received an email from me with your mark, email me and I'll send you your mark. I've also finally put up the ray tracing pictures . . . check them out here and send me your opinions on which pictures is the best. Please refer to the number by the picture. I'll be standing around at your final exam so you can pick up your assignment marking sheets there from me. Also if you'd like to know what your mark is what it is email me and I'll give you the details. Good luck on your finals!
  • WARNING - I managed to botch the stuff I was talking about in the last lab. In particular in the first lab I gave you the wrong z coordinate for your viewing plane. The two mistakes are: you are looking down the z axis so you should be using -z values, and the other is the actual z depth I gave you is wrong, I used the wrong angle and got a wrong z value (sqrt(3)/2). Instead you want a zvalue of -2.414. For the diagram of how I found that z value check the ugly diagram below. So all in all, your place your eye at (0,0,0) and your viewing plane is defined by the corners: (-1,-1,-2.414), (1,-1,-2.414), (1,1,-2.414), and (-1,1,-2.414). Sorry for all the confusion on this. Also check out for better notes on refractions. If this confuses you at all or you notice that I've made another mistake please email me ASAP!
  • December 4 - Our very last lab. The test scene can be found here. In lab today I'll be talking about this test scene and a little bit about how to get some bonus marks.
  • December 2 - Complete overview of the ray tracer! Hey all, I also want to see the funkiest ray tracing pictures you come up with. Email them to me in jpg format and I'll post them here. You can easily change ppm files to jpg using the program xv (type xv at the command line). The person who submits the best picture will be awarded a bag of doritos and a 2L bottle of Coke (that's right Coke, not Pepsi). Also check out some of the cool ray-traced pictures from Kevin Foster's lab last year here.
  • November 27 - Show up for Assignment 3 demos!
  • November 25 - Today I'm going through some of the basics for ray tracing. I'll be talking about using the ppm libraries, ray casting, and sphere intersections.
  • November 20 - I'll be doing predemos for those who want to do them.
  • November 18 - I'll be going over how to refine your bezier surface and other general assignment 3 things.
  • November 14 - In lab I did a pretty bad job of explaining how to select points. Check here for better notes on how to do this. Good luck with your assignments this weekend.
  • November 13 - Going over UI and necessary OpenGL code for assignment 3. If you come you will find assignment 3 easier!
  • Email me to sign up for assignment 2 demos. These demo wil be done outside of lab times, the availible times can be found here. Also assignment 3 is due the Friday after next so get started now. I've created short guide for this assignment here.
  • Assignment 2 has been extended until SATURDAY! I'm keeping a list of questions I've answered about assignment two here. Check it out.
  • November 6 - Come to lab to pre-demo your assignment.
  • November 4 - The lab on Tuesday will be for asking any questions you have about assignment 2. If there's something you would like me to cover please email me or ask me in class.
  • October 30 - I don't have anything new to cover so I'll just say a couple of things about assignment 2 and have you work on your assignments while I help out with any questions you may have. If there's something you'd like me to cover, email me and I'll prepare something.
  • October 28 - I'll be going over normal calculations and lighting/shading in OpenGL. See section 6.5 of Interactive Computer Graphics, Pauline's Web Site, or Chapter 6 of the Red OpenGL book for more info on lighting, shading, etc in OpenGL.
  • October 21 - The Projection Lab. I will be reviewing perspective and orthographic projects as well as changes to the model view matrix as covered in lecture. I will then talk about how to do this in openGL. A demo is availible here . I made a couple of mistakes in that parser code:
    • use fopen("filename","r") instead of fopen("filename")
    • to read in floats with sscanf use sscanf("%f %f %f", . . . ) instead of sscanf("%u %u %u", . . . ) - the %u is what you use for reading in unsigned integers.
    • also change sscanf("%f %f %f",line[1] . . . ) to either sscanf("%f %f %f",line[2] . . . ) or sscanf(" %f %f %f",line[1]). If we truly have a vertex then the char at line[1] is a space and this space will mess sscanf up if you don't account for it.
    • you probably should also add #include <stdio.h> and #include <stdlib.h>
  • October 16 - I went over how to code mouse and keyboard events. If you want details on this you can check out the qt website here for mouse events and here for keyboard events. Also check out section 4.10.2 in your graphics text book for some ideas on hooking up your mouse to the rotation of your object. I did a brief overview of gl lists and glpush/pop. For more information about gl lists check out page 100 of your text.
  • October 14 - Talked about assignment 1 marks, assignment 2, midterm and some other stuff.
  • October 12 - Find your assignment 1 mark here.
  • October 9 - I talked briefly about signals & slots, mouse code, keyboard code, and assignment 2. Be sure to check out the assignment two specs here as soon as possible.
  • October 7 - I'll be doing demos in lab. You have probably noticed that I haven't set up a sign-up sheet for demos. Instead I'll work my way alphabetically through each lab. If you don't think this will work for you send me an email (or talk to me). I hope to get through all the demos today so you MUST show up or lose HUGE marks. I'll be arranging something for you to do while you're waiting to demo.
  • October 2 - I'll be doing pre-demos that should give you an idea of what to work on before handing in your assignments on Sunday.
  • September 30 - I'll being talking for about 15 minutes on creating structures for points, colors, and vectors. I'll also mention the submit system and how you should be making the pdf files for your documentation. The rest of the lab is for working on your assignments with me lending a helping hand where I can. Code for the vector.h class I described is here. I've added a couple of operators that I didn't mention in class so it's worth a look.
  • September 23 & 25 - On Tuesday we went through Kelly Poon's fractal starter code. We added a point structure and two functions. The first function drawTriangle(Point a, Point b, Point c) draws a triangle via openGL. The second function drawSierpinski(Point a, Point b, Point c) implements the Sierpinski fractal code you were given in lecture. With this code you're pretty much done the first part of assignment 1. On Thursday we are going through a QT tutorial I've created. You can find this tutorial here. At this point you have absolutely everything you need to write your assignment 1 program.
  • September 16 & 18 - The first lab. We'll be ensuring that everyone can log in, looking at and compiling a simple glut example, and possible looking at and compiling some QT code. The glut code is here. The QT code is here.
  • September 9 & 11 - No Labs This Week.

Reminders for Assignment 2
  • Check out my quesiton list here.
  • Assignment 2 is now due Saturday, November 8.

Reminders for Assignment 1
  • You must use a bunch of different colors. To do this simply, just use a random color for each triangle (type in "man rand" at the shell to find out about a common C++ random number generator). If you want to be cool make the color dependant on the level of the gasket, or upon the color of the neighbor or something like that.
  • You have to demo your program to me in the lab immediately after the assignment is due. So for assignment 1 that will be October 7th. If you don't show up you will likely get a zero.
  • You can use recursive solutions like the one shown in class to draw fractals or, if you like you can use rotations and transformations.
  • Please, please, please remember that these programs have to run on the LINUX machines in the graphics lab rather than on a windows machine, your machine at home, or whatever.
  • Use the submit system to submit your code and documentation.
  • Your documentation must be in pdf format. Text and word files are not acceptable.
  • Email me if you have any questions!

Other useful pages