Is this <hint>normal</hint> behavior?

May 10th, 2006

Have you noticed that the lighting calculations don’t seem to be affecting your windshield the same way they affect the rest of the car?

I wonder which part of the illumination equation isn’t being evaluated normally.

Chapter mismatch between HTML and PDF versions of the Red Book

May 6th, 2006

It would appear that the HTML and PDF versions of the Red Book are different editions, with different Chapter divisions. The Chapter 12 you want is “Selection and Feedback”, not “Evaluators and NURBS.” The next chapter, “Lighting”, has the same problem.

Assignment 9

April 28th, 2006

Assignment 9 is available. Trust me — the assignment will be easier if you attend class and implement the version of the algorithm that we discuss.

Slides for tonight’s lecture

April 15th, 2006

For the second half of tonight’s lecture, we’ll be looking at the Aliasing and Antialiasing slides in the ACM SIGGRAPH 1993 Education Slide Set. There are some visual effects here that I wouldn’t be able to draw on a whiteboard to save my life.

A note on doing the work yourself

April 14th, 2006

I realize that in Assignment 6 and Assignment 7 where we deal with well-known algorithms, it will be especially tempting to use someone else’s implementation — they are, after all, readily available on teh interwebs.

Note, however, the following:

  1. Turning in code you didn’t write yourself is Academic Dishonesty.
  2. Using someone else’s pseudocode is fine, as long as you credit the source.
  3. If you do use someone else’s pseudocode, make sure you understand what it does.
  4. There will be at least one question on each algorithm on the Final Exam.
  5. If you take the time to implement the algorithm yourself, you will be more likely to remember it well enough to earn full credit on the exam.

Remember also that if you are struggling with an algorithm, you are allowed to work on homework assignments with a partner.

Hint: pick a partner who’s smarter than you are.

Announcements

April 8th, 2006

Assignment 6 is available.

Note the updated office hours shown to the left: I’ve been able to rearrange my work schedule in order to be available before class. Be sure to drop by and visit.

GLIntercept

April 1st, 2006

Here’s a cool debugging tool for OpenGL on Windows: GLIntercept. You can use it to track every OpenGL function call along with its parameters. (For those of you familiar with UNIX, this is like truss(1) or strace(1), only for OpenGL calls instead of system calls.)

Here’s a 30-second walkthrough:

  1. Download and run the Windows installer. You’ll end up with a new directory, C:\Program Files\GLIntercept0_5.
  2. Copy OpenGL32.dll and gliConfig_FullDebug.ini to the same directory as your program. Rename gliConfig_FullDebug.ini to gliConfig.ini
  3. Run your program. A new file will be created in the same directory called gliInterceptLog.txt, containing every OpenGL call your program makes. (You may also find that your program is a little slower).

Here’s some of the output from running assignment5.c:

glClearColor(0.000000,0.000000,0.000000,0.000000)
wglGetCurrentContext()=0x10000
wglGetCurrentDC()=0xb70114f8
wglGetCurrentContext()=0x10000
wglGetCurrentDC()=0xb70114f8
glViewport(0,0,600,300)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0.000000,2.000000,0.000000,1.000000,-1.000000,1.000000)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
glClear(GL_COLOR_BUFFER_BIT)
glColor3f(1.000000,1.000000,0.000000)
glBegin(GL_LINES)
glVertex3f(1.000000,0.000000,0.000000)
glVertex3f(1.000000,1.000000,0.000000)
glEnd()
glViewport(300,0,300,300)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glFrustum(-1.500000,1.500000,-1.500000,1.500000,2.000000,8.000000)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
glMultMatrixf([1.000000,0.000000,0.000000,0.000000,
             0.000000,1.000000,0.000000,0.000000,
             0.000000,0.000000,1.000000,0.000000,
             0.000000,0.000000,0.000000,1.000000])
glTranslated(0.000000,0.000000,-6.500000)
glPushMatrix()
glPushMatrix()
glColor3f(1.000000,0.000000,0.000000)
glBegin(GL_LINE_LOOP)
glNormal3fv([0.000000,0.000000,-1.000000])
glVertex3fv([0.500000,0.500000,-0.500000])
glVertex3fv([0.500000,-0.500000,-0.500000])
glVertex3fv([-0.500000,-0.500000,-0.500000])
glVertex3fv([-0.500000,0.500000,-0.500000])
glEnd()

Running with gliConfig_FullDebug.ini also makes sure that every call to an OpenGL function is checked with glGetError(), which will catch things like passing bad values to functions or trying to pop the matrix stack more times that it’s been pushed.

To make the best use of a tool like this, you’ll probably want a utility to tail the log as your program is running. (I’m told there are also GUI versions).

Note that you don’t need access to the source code — if you have a game at home that uses OpenGL, you can watch what it’s doing, too. (Just don’t steal their code, and don’t tell them I’m the one who told you how.)

GLIntercept has a few more tricks up its sleeve, but I’ll leave it up to you to read about them. For Linux people, there’s a similar program called BuGLe, but I haven’t tried it. And, of course, we smug OS X weenies have the OpenGL Profiler.

For those of you using Igloo, I’ve put together a new debug package that includes GLIntercept and Windows port of GNU tail. I’m not entirely sure about the legality of all this — GLIntercept and GNU tail are available under the GNU General Public license, but EiC is still MIA.

Why Microsoft is not my favorite software company

March 18th, 2006

The grade sheet that I posted a few minutes ago is rather hard to read in Internet Explorer. It looks like the bottom few pixels of each row are cut off.

The HTML file was generated by setting a print area and choosing Save As Web Page from the File menu in Excel 2004 for Mac.

I understand cross-browser differences. I even understand cross-platform differences. But if I can’t save a web page from the latest version of one Microsoft product and have it readable from the latest version of another Microsoft product, well…

You should all be using Mozilla Firefox anyway. It looks fine there.

Assignment 5

March 11th, 2006

Assignment 5 is available. Note that this is the last assignment due before the Midterm Exam on March 24.

Pop-quizzes and pedagogy

March 7th, 2006

A study from Washington University in St. Louis finds that

quizzes — given early and often — may be a student’s best friend when it comes to understanding and retaining information for the long haul

Say, that gives me an idea…