/var/spool/weblog
   


Prof Avery's weblog
touched by an anvil

<spool@kenytt.net>

CSU Fullerton Perl Powered Python vi Hacker

Geek News

del.icio.us bookmarks

RSS


       
Fri, May 19, 2006

Minimal Ray Tracer
Some code to accompany tonight's lecture: a version of Paul Heckbert's Minimal Ray Tracer from Graphics Gems IV.

I've updated the code to do the following:

  • compile with GNU C
  • output plain PPM
  • generate a 1024 by 1024 image instead of the tiny 32-pixel original
I've also included a JPEG version of the image, generated with ppmtojpeg,

If you want to experiment with changing the scene defined in ray.h, you'll probably want to download NetPbm for Windows.

/var/spool/courses/csuf/2006/spring/cpsc465 #

Sat, May 13, 2006

Assignment 10
If you didn't finish Assignment 10, you can download assignment10.c as a starting point for Assignment 11.

/var/spool/courses/csuf/2006/spring/cpsc465 #

Fri, May 12, 2006

Demos for tonight's lecture
There are two demonstration program for tonight's lecture:

You will need the texture mapping technique for Assignment 11.

/var/spool/courses/csuf/2006/spring/cpsc465 #

Pixar's On-line Library
I happened across this the other day: Pixar has made available an On-line library of technical papers. Many of them are probably a bit advanced, but worth a look if you're considering further study.

/var/spool/courses/csuf/2006/spring/cpsc465 #

Wed, May 10, 2006

Is this normal behavior?
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.

/var/spool/courses/csuf/2006/spring/cpsc465 #

Material Colors
Here's a function to set the current drawing color, whether or not lighting is enabled:

    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 GL_COLOR_MATERIAL.

/var/spool/courses/csuf/2006/spring/cpsc465 #

Fri, May 05, 2006

Chapter mismatch between HTML and PDF versions of the Red Book
HTML and PDF versions of the Red Book -- they're 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.

/var/spool/courses/csuf/2006/spring/cpsc465 #


       

 

December 2017
Sun Mon Tue Wed Thu Fri Sat
         
           

RSS

Topics


Archives