CS348b2007

Installing PBRT

I didn't have too bad a time installing PBRT for both VS 2003 (at home) and VS 2005 (on campus). I spent some time, however, trying to make the process work a little nicer.

Coordinate System

As others have noticed PBRT sometimes has strange coordinate system problems. The problem is that the LookAt() function is implemented incorrectly. On page 76 of the book the authors describe how to compute the right and up vectors for the LookAt matrix: right = up X dir. and newUp = dir X right. However, in the subsequent code segment, they compute: right = dir X up and newUp = right X dir. This switches the direction of the right vector.

The result is that any scene that uses LookAt to place the camera will behave like a right-handed coordinate system, except, rotations around the x and z axes will be clockwise, rather than counterclockwise. Any scene that uses some other Transform method to place the camera will be correct (left-handed).

If you choose to fix LookAt(), beware that you will also have to manually fix any scenes that were designed to be rendered with the old LookAt.

Here's a diff for the fix: http://research.justintalbot.org/pbrt/transform.cpp.1.diff

last edited 2007-04-14 01:28:06 by JustinTalbot