/var/spool/weblog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Geek News del.icio.us bookmarks RSS |
Fri, May 19, 2006
Minimal Ray Tracer
I've updated the code to do the following:
ppmtojpeg ,
If you want to experiment with changing the scene defined in /var/spool/courses/csuf/2006/spring/cpsc465 # Sat, May 13, 2006
Assignment 10
/var/spool/courses/csuf/2006/spring/cpsc465 # Fri, May 12, 2006
Demos for tonight's lecture
/var/spool/courses/csuf/2006/spring/cpsc465 #
Pixar's On-line Library
/var/spool/courses/csuf/2006/spring/cpsc465 # Wed, May 10, 2006
Is this
I wonder which part of the illumination equation isn't being evaluated /var/spool/courses/csuf/2006/spring/cpsc465 #
Material Colors
void color(double r, double g, double b) { float color[4] = { r, g, b, 1.0 }; if (glIsEnabled(GL_LIGHTING)) { glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color); } else { glColor3f(r, g, b); } }Note that although the color can be set for GL_AMBIENT and GL_DIFFUSE separately, you'll usually want them to be the same.
Alternatively, you could try reading about /var/spool/courses/csuf/2006/spring/cpsc465 # Fri, May 05, 2006
Chapter mismatch between HTML and PDF versions of the Red Book
/var/spool/courses/csuf/2006/spring/cpsc465 # Fri, Apr 28, 2006
Assignment 9
/var/spool/courses/csuf/2006/spring/cpsc465 # Fri, Apr 14, 2006
Slides for tonight's lecture
/var/spool/courses/csuf/2006/spring/cpsc465 #
A note on doing the work yourself
Note, however, the following:
Hint: pick a partner who's smarter than you are. /var/spool/courses/csuf/2006/spring/cpsc465 # Fri, Apr 07, 2006
Announcements
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. /var/spool/courses/csuf/2006/spring/cpsc465 # Fri, Mar 31, 2006
GLIntercept
Here's a 30-second walkthrough:
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. /var/spool/courses/csuf/2006/spring/cpsc465 # Sat, Mar 18, 2006
Why Microsoft is not my favorite software company
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. /var/spool/courses/csuf/2006/spring/cpsc465/misc #
Homework Grades
If you turned in an assignment that isn't recorded, or if you didn't get as high a score on an assignment as you think you should have, please e-mail me. /var/spool/courses/csuf/2006/spring/cpsc465 # Fri, Mar 10, 2006
Assignment 5
/var/spool/courses/csuf/2006/spring/cpsc465 # Mon, Mar 06, 2006
Another schedule update
For those of you wondering why I've been making changes to the schedule, I've taught the course two different ways in the past:
I'd originally planned to teach this semester as a lecture course, but when it was scheduled for a single class meeting on Friday nights a couple of things became clear:
/var/spool/courses/csuf/2006/spring/cpsc465 #
Vector Math Tutorial for 3D Computer Graphics
/var/spool/courses/csuf/2006/spring/cpsc465 #
A correction
If you compare it with the original screenshot, you'll notice that the original wasn't really a parallel projection.
The problem is that (as you should recall from your reading) OpenGL is a state machine. When you make a function call like
My mistake was to draw the parallel projections (calling To avoid making silly mistakes like me, do the following whenever you go to render a model (e.g., in your display callback):
/var/spool/courses/csuf/2006/spring/cpsc465 # Thu, Mar 02, 2006
Don't cross the streams
By the way, Assignment 4 is available. /var/spool/courses/csuf/2006/spring/cpsc465 # Fri, Feb 24, 2006
Assignment 3
/var/spool/courses/csuf/2006/spring/cpsc465 # Mon, Feb 20, 2006
Demo version of Assignment 2
My version needed 14 new lines of code: a function to implement the vector cross product operation and some changes to the function /var/spool/courses/csuf/2006/spring/cpsc465 # Sun, Feb 19, 2006
Assignment 2 update
To fix the issue, replace Line 194 may cause some compilers to issue warnings: glutPostRedisplay;should be glutPostRedisplay(); /var/spool/courses/csuf/2006/spring/cpsc465 # Sat, Feb 18, 2006
Assignment 2
/var/spool/courses/csuf/2006/spring/cpsc465 # Fri, Feb 17, 2006
Stop trying so hard!
In the meantime, here are the GL functions I called in my solution for Assignment 1:
glViewport() .
If your list looks significantly different from mine, and especially if you're trying to translate the square to move it around the window or use a pick list to figure out whether the user clicked it, you've gone down the wrong path. We're not even going to talk about translation until next week. (Well, ok, possibly this week; but if so, only at the end.) /var/spool/courses/csuf/2006/spring/cpsc465 # Wed, Feb 15, 2006
An easy way to run OpenGL programs
Grab a copy of igloo.zip and unzip it somewhere convenient. Run the program by typing C:\igloo> igloo gears.cCool. No compilation step, no moving headers and library files around, just type and go. And in less than 230 Kb. Igloo is a version of the EIC C Interpreter, an Open Source project that seems to have gone missing in action. Luckily, I saved a copy, just for you. I wish I'd saved a copy of the source code, too, but at least there are lots of other C interpreters. So what's the catch?
/var/spool/courses/csuf/2006/spring/cpsc465/misc # |
Topics
Archives
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||