<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>/var/spool/weblog   </title>
    <link>http://www.kenytt.net/spool</link>
    <description>UNIX, Perl, Python, and a short fuse</description>
    <language>en</language>

  <item>
    <title>Minimal Ray Tracer</title>
    <link>http://www.kenytt.net/spool/2006/05/19#1148080957</link>
    <description>
Some &lt;a href=&quot;/courses/csuf/2006/spring/465/download/minray.zip&quot;&gt;code&lt;/a&gt; to accompany tonight's lecture: a version of &lt;a href=&quot;http://www.cs.cmu.edu/~ph/&quot;&gt;Paul Heckbert&lt;/a&gt;'s Minimal Ray Tracer from &lt;a href=&quot;http://www.cs.cmu.edu/~ph/gem4.html&quot;&gt;Graphics Gems IV&lt;/a&gt;.

&lt;p&gt;

I've updated the code to do the following:
&lt;ul&gt;
    &lt;li&gt;compile with GNU C
    &lt;li&gt;output &lt;a href=&quot;http://netpbm.sourceforge.net/doc/ppm.html&quot;&gt;plain PPM&lt;/a&gt;
    &lt;li&gt;generate a 1024 by 1024 image instead of the tiny 32-pixel original
&lt;/ul&gt;

I've also included a JPEG version of the image, generated with &lt;code&gt;ppmtojpeg&lt;/code&gt;, 

&lt;p&gt;

If you want to experiment with changing the scene defined in &lt;code&gt;ray.h&lt;/code&gt;, you'll probably want to download &lt;a href=&quot;http://gnuwin32.sourceforge.net/packages/netpbm.htm&quot;&gt;NetPbm for Windows&lt;/a&gt;.

</description>
  </item>
  <item>
    <title>Assignment 10</title>
    <link>http://www.kenytt.net/spool/2006/05/13#1147571517</link>
    <description>
If you didn't finish &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst10&quot;&gt;Assignment 10&lt;/a&gt;, you can download &lt;a href=&quot;/courses/csuf/2006/spring/465/code/assignment10.c&quot;&gt;assignment10.c&lt;/a&gt; as a starting point for &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst11&quot;&gt;Assignment 11&lt;/a&gt;.
</description>
  </item>
  <item>
    <title>Demos for tonight's lecture</title>
    <link>http://www.kenytt.net/spool/2006/05/12#1147478041</link>
    <description>
There are two demonstration program for tonight's lecture:
&lt;ul&gt;
    &lt;li&gt;&lt;a href=&quot;/courses/csuf/2006/spring/465/code/shading.c&quot;&gt;shading.c&lt;/a&gt;
    &lt;li&gt;&lt;a href=&quot;/courses/csuf/2006/spring/465/code/texture.c&quot;&gt;texture.c&lt;/a&gt;
&lt;/ul&gt;

You will need the texture mapping technique for &lt;a
href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst11&quot;&gt;Assignment
11&lt;/a&gt;.

&lt;p&gt;
</description>
  </item>
  <item>
    <title>Pixar's On-line Library</title>
    <link>http://www.kenytt.net/spool/2006/05/12#1147479360</link>
    <description>
I happened across this the other day: &lt;a href=&quot;http://www.pixar.com/&quot;&gt;Pixar&lt;/a&gt; has made available an &lt;a href=&quot;http://graphics.pixar.com/&quot;&gt;On-line library&lt;/a&gt; of technical papers.  Many of them are probably a bit advanced, but worth a look if you're considering further study.
</description>
  </item>
  <item>
    <title>Is this &lt;hint&gt;normal&lt;/hint&gt; behavior?</title>
    <link>http://www.kenytt.net/spool/2006/05/10#1147238663</link>
    <description>
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?

&lt;p&gt;

I wonder which part of the illumination equation isn't being evaluated &lt;hint&gt;normally&lt;/hint&gt;.
</description>
  </item>
  <item>
    <title>Material Colors</title>
    <link>http://www.kenytt.net/spool/2006/05/10#1147238273</link>
    <description>
Here's a function to set the current drawing color, whether or not lighting is enabled:

&lt;pre&gt;
    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);
        }
    }
&lt;/pre&gt;

Note that although the color can be set for &lt;code&gt;GL_AMBIENT&lt;/code&gt; and &lt;code&gt;GL_DIFFUSE&lt;/code&gt; separately, you'll usually want them to be the same.

&lt;p&gt;

Alternatively, you could try &lt;a href=&quot;http://www.rush3d.com/reference/opengl-redbook-1.1/chapter06.html&quot;&gt;reading&lt;/a&gt; about &lt;code&gt;GL_COLOR_MATERIAL&lt;/code&gt;.
</description>
  </item>
  <item>
    <title>Chapter mismatch between HTML and PDF versions of the Red Book</title>
    <link>http://www.kenytt.net/spool/2006/05/05#1146863523</link>
    <description>
&lt;A After receiving a couple of questions about NURBS, I took a closer look at the &lt;a href=&quot;http://www.rush3d.com/reference/opengl-redbook-1.1/&quot;&gt;HTML&lt;/a&gt; and &lt;a href=&quot;http://www.gamedev.net/download/redbook.pdf&quot;&gt;PDF&lt;/a&gt; versions of the Red Book -- they're different editions, with different Chapter divisions.  The &lt;a href=&quot;http://www.rush3d.com/reference/opengl-redbook-1.1/chapter12.html&quot;&gt;Chapter 12&lt;/a&gt; you want is &quot;Selection and Feedback&quot;, not &quot;Evaluators and NURBS.&quot;  The next chapter, &quot;Lighting&quot;, has the same problem.
</description>
  </item>
  <item>
    <title>Assignment 9</title>
    <link>http://www.kenytt.net/spool/2006/04/28#1146234512</link>
    <description>
&lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst9&quot;&gt;Assignment 9&lt;/a&gt; is available.  Trust me -- the assignment will be easier if you attend class and implement the version of the algorithm that we discuss.
</description>
  </item>
  <item>
    <title>Slides for tonight's lecture</title>
    <link>http://www.kenytt.net/spool/2006/04/14#1145045208</link>
    <description>
For the second half of tonight's lecture, we'll be looking at the &lt;a href=&quot;http://www.siggraph.org/education/curriculum/projects/slide_sets/slides93/01_93_2.htm&quot;&gt;Aliasing and Antialiasing&lt;/a&gt; slides in the ACM SIGGRAPH &lt;a href=&quot;http://www.siggraph.org/education/curriculum/projects/slide_sets/slides93/slides93.htm&quot;&gt;1993 Education Slide Set&lt;/a&gt;.  There are some visual effects here that I couldn't draw on a whiteboard to save my life.
</description>
  </item>
  <item>
    <title>A note on doing the work yourself</title>
    <link>http://www.kenytt.net/spool/2006/04/14#1145042335</link>
    <description>
I realize that in &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst6&quot;&gt;Assignment 6&lt;/a&gt; and &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst7&quot;&gt;Assignment 7&lt;/a&gt; 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 &lt;a href=&quot;http://www.google.com/search?q=bresenham+filetype%3Ac&quot;&gt;teh interwebs&lt;/a&gt;.

&lt;p&gt;

Note, however, the following:

&lt;ol&gt;
    &lt;li&gt;Turning in code you didn't write yourself is Academic Dishonesty.
    &lt;li&gt;Using someone else's pseudocode is fine, as long as you credit the source.
    &lt;li&gt;If you do use someone else's pseudocode, make sure you understand what it does.
    &lt;li&gt;There will be at least one question on each algorithm on the Final Exam.
    &lt;li&gt;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.
&lt;/ol&gt;

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

&lt;p&gt;

&lt;i&gt;Hint&lt;/i&gt;: pick a partner who's smarter than you are.
</description>
  </item>
  <item>
    <title>Announcements</title>
    <link>http://www.kenytt.net/spool/2006/04/07#1144447550</link>
    <description>
&lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst6&quot;&gt;Assignment 6&lt;/a&gt; is available.  

&lt;p&gt;

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.
</description>
  </item>
  <item>
    <title>GLIntercept</title>
    <link>http://www.kenytt.net/spool/2006/03/31#1143853805</link>
    <description>
Here's a cool debugging tool for OpenGL on Windows: &lt;a href=&quot;http://glintercept.nutty.org/&quot;&gt;GLIntercept&lt;/a&gt;.  You can use it to track every OpenGL function call along with its parameters.  (For those of you familiar with UNIX, this is like &lt;tt&gt;truss&lt;/tt&gt;(1) or &lt;tt&gt;strace&lt;/tt&gt;(1), only for OpenGL calls instead of system calls.)

&lt;p&gt;

Here's a 30-second walkthrough:
&lt;ol&gt;
    &lt;li&gt;Download and run the Windows &lt;a href=&quot;http://glintercept.nutty.org/download.html&quot;&gt;installer&lt;/a&gt;.  You'll end up with a new directory, &lt;tt&gt;C:\Program Files\GLIntercept0_5&lt;/tt&gt;.
    &lt;li&gt;Copy &lt;tt&gt;OpenGL32.dll&lt;/tt&gt; and &lt;tt&gt;gliConfig_FullDebug.ini&lt;/tt&gt; to the same directory as your program.  Rename &lt;tt&gt;gliConfig_FullDebug.ini&lt;/tt&gt; to &lt;tt&gt;gliConfig.ini&lt;/tt&gt;
    &lt;li&gt;Run your program.  A new file will be created in the same directory called &lt;tt&gt;gliInterceptLog.txt&lt;/tt&gt;, containing every OpenGL call your program makes.  (You may also find that your program is a little slower).
&lt;/ol&gt;

Here's some of the output from running &lt;a href=&quot;/courses/csuf/2006/spring/465/code/assignment5.c&quot;&gt;assignment5.c&lt;/a&gt;:

&lt;pre&gt;
    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()
&lt;/pre&gt;

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

&lt;p&gt;

To make the best use of a tool like this, you'll probably want a &lt;a href=&quot;http://unxutils.sourceforge.net/&quot;&gt;utility&lt;/a&gt; to &lt;a href=&quot;http://en.wikipedia.org/wiki/Tail_(Unix)&quot;&gt;tail&lt;/a&gt; the log as your program is running.  (I'm told there are also &lt;a href=&quot;http://www.makelogic.com/tail/TailHome.htm&quot;&gt;GUI versions&lt;/a&gt;).

&lt;p&gt;

Note that you don't need access to the source code -- if you have a game at home that uses OpenGL, you can &lt;a href=&quot;http://hacks.oreilly.com/pub/h/5235&quot;&gt;watch what it's doing&lt;/a&gt;, too.  (Just don't steal their code, and don't tell them I'm the one who told you how.)

&lt;p&gt;

GLIntercept has a few more tricks up its sleeve, but I'll leave it up to you to &lt;a href=&quot;http://glintercept.nutty.org/&quot;&gt;read about them&lt;/a&gt;.  For Linux people, there's a similar program called &lt;a href=&quot;http://bugle.sourceforge.net/&quot;&gt;BuGLe&lt;/a&gt;, but I haven't tried it.  And, of course, we smug OS X weenies have the &lt;a href=&quot;http://developer.apple.com/graphicsimaging/opengl/profiler_image.html&quot;&gt;OpenGL Profiler&lt;/a&gt;.

&lt;p&gt;

For those of you using &lt;a href=&quot;http://www.kenytt.net/spool/2006/02/11#1140057517&quot;&gt;Igloo&lt;/a&gt;, I've put together a new &lt;a href=&quot;/courses/csuf/2006/spring/465/download/igloo-debug.zip&quot;&gt;debug package&lt;/a&gt; that includes GLIntercept and Windows port of &lt;a href=&quot;http://www.gnu.org/software/coreutils/manual/html_chapter/coreutils_5.html#SEC19&quot;&gt;GNU tail&lt;/a&gt;.  I'm not entirely sure about the legality of all this -- GLIntercept and GNU tail are available under the GNU General Public license, but &lt;a href=&quot;http://eic.sourceforge.net/&quot;&gt;EiC&lt;/a&gt; is still MIA.
</description>
  </item>
  <item>
    <title>Why Microsoft is not my favorite software company</title>
    <link>http://www.kenytt.net/spool/2006/03/18#1142664344</link>
    <description>
The &lt;a href=&quot;/courses/csuf/2006/spring/465/grades.htm&quot;&gt;grade sheet&lt;/a&gt; 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.

&lt;p&gt;

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

&lt;p&gt;

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

&lt;p&gt;

You should all be using &lt;a href=&quot;http://www.mozilla.org/firefox/&quot;&gt;Mozilla Firefox&lt;/a&gt; anyway.  It looks fine there.

</description>
  </item>
  <item>
    <title>Homework Grades</title>
    <link>http://www.kenytt.net/spool/2006/03/18#1142664148</link>
    <description>
I've posted &lt;a href=&quot;/courses/csuf/2006/spring/465/grades.htm&quot;&gt;grades&lt;/a&gt; as of 10:41pm Friday 3/17.

&lt;p&gt;

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.
</description>
  </item>
  <item>
    <title>Assignment 5</title>
    <link>http://www.kenytt.net/spool/2006/03/10#1142031490</link>
    <description>
&lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst5&quot;&gt;Assignment 5&lt;/a&gt; is available.  Note that this is the last assignment due before the Midterm Exam on March 24.</description>
  </item>
  <item>
    <title>Another schedule update</title>
    <link>http://www.kenytt.net/spool/2006/03/06#1141677658</link>
    <description>
Please note that I've updated the &lt;a href=&quot;/courses/csuf/2006/spring/465/outline.html&quot;&gt;Course Outline&lt;/a&gt; again.

&lt;p&gt;

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:

&lt;ol&gt;
	&lt;li&gt;As a lab course with weekly assignments
	&lt;li&gt;As a lecture course with 4 or 5 larger programming assignments
&lt;/ol&gt;

In courses of type &lt;i&gt;(1)&lt;/i&gt;, we cover the basic techniques of 3D graphics and you get a lot of experience implementing them.  In courses of type &lt;i&gt;(2)&lt;/i&gt; we talk about a broader range of topics, but for most of them you never get a chance to see the code.

&lt;p&gt;

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:

&lt;ol&gt;
	&lt;li&gt;The building would be nearly empty, and we could have our pick of labs
	&lt;li&gt;In a lecture course, everyone would be asleep  by 8:45
&lt;/ol&gt;

So I'm adjusting the outline as we go along.  I think we're on track for the rest of the semester, but don't be surprised if there's at least one more change before the end.
</description>
  </item>
  <item>
    <title>Vector Math Tutorial for 3D Computer Graphics</title>
    <link>http://www.kenytt.net/spool/2006/03/06#1141676909</link>
    <description>
If you need to brush up on your math before the midterm, the &lt;a href=&quot;http://chortle.ccsu.edu/VectorLessons/vectorIndex.html&quot;&gt;Vector Math for 3D Computer Graphics&lt;/a&gt; from the Computer Science department at Central Connecticut State University is a pretty good review.
</description>
  </item>
  <item>
    <title>A correction</title>
    <link>http://www.kenytt.net/spool/2006/03/06#1141674940</link>
    <description>
If you were paying attention over the weekend, you noticed that I updated the screenshot for &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst4&quot;&gt;Assignment 4&lt;/a&gt;.

&lt;p&gt;

If you compare it with the &lt;a href=&quot;/courses/csuf/2006/spring/465/images/assignment4-bad.gif&quot;&gt;original screenshot&lt;/a&gt;, you'll notice that the original wasn't really a parallel projection.

&lt;p&gt;

The problem is that (as you should recall from your reading) OpenGL is a &lt;i&gt;state machine&lt;/i&gt;.  When you make a function call like &lt;code&gt;gluPerspective()&lt;/code&gt; to update the current projection matrix, that change stays in effect until you reset the matrix (e.g., with &lt;code&gt;glLoadIdentity()&lt;/code&gt;.

&lt;p&gt;

My mistake was to draw the parallel projections (calling &lt;code&gt;glOrtho()&lt;/code&gt;) without remembering to reset the projection matrix, which had already been set with &lt;code&gt;gluPerspective&lt;/code&gt;.  The result was that we took a cube in perspective, then drew a parallel projection of the perspective rendering.  &lt;i&gt;Oops&lt;/i&gt;.  I didn't notice because it looks &quot;sort of&quot; right -- there was, in fact, a parallel projection happening.

&lt;p&gt;

To avoid making silly mistakes like me, do the following whenever you go to render a model (e.g., in your display callback):

&lt;ol&gt;
	&lt;li&gt;Set the viewport.
		&lt;table border=&quot;1&quot; align=&quot;center&quot; cellpadding=&quot;5&quot; nowrap&gt;
			&lt;tr&gt;&lt;td&gt;&lt;code&gt;
				glViewport(0, 0, width, height);
			&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;/table&gt;
	&lt;li&gt;Set up the projection.
		&lt;table border=&quot;1&quot; align=&quot;center&quot; cellpadding=&quot;5&quot; nowrap&gt;
			&lt;tr&gt;&lt;td&gt;&lt;code&gt;
				glMatrixMode(GL_PROJECTION);&lt;br&gt;
				glLoadIdentity();&lt;br&gt;
				glOrtho(-2.0, 2.0, -2.0, 2.0, 0.0, 10.0);
			&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;/table&gt;
	&lt;li&gt;Set your viewing parameters.
		&lt;table border=&quot;1&quot; align=&quot;center&quot; cellpadding=&quot;5&quot; nowrap&gt;
			&lt;tr&gt;&lt;td&gt;&lt;code&gt;
				glMatrixMode(GL_MODELVIEW);&lt;br&gt;
				glLoadIdentity();&lt;br&gt;
				gluLookAt(0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
			&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;/table&gt;
	&lt;li&gt;Draw the scene.
		&lt;table border=&quot;1&quot; align=&quot;center&quot; cellpadding=&quot;5&quot; nowrap&gt;
			&lt;tr&gt;&lt;td&gt;&lt;code&gt;
				glClearColor(0.0, 0.0, 0.0, 1.0);&lt;br&gt;
				glClear(GL_COLOR_BUFFER_BIT);&lt;br&gt;
				&lt;br&gt;
				glColor(0.0, 0.0, 1.0);&lt;br&gt;
				glutWireSphere(1.0, 10, 10);
			&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;/table&gt;
&lt;/ol&gt;
</description>
  </item>
  <item>
    <title>Don't cross the streams</title>
    <link>http://www.kenytt.net/spool/2006/03/02#1141333869</link>
    <description>
If you're still working on &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst3&quot;&gt;Assignment 3&lt;/a&gt;, note that the coordinate axes (the lines in gray) should not be moving when you transform the cube.  The axes should remain at the center of the world, not at the center of your model.

&lt;p&gt;

By the way, &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst4&quot;&gt;Assignment 4&lt;/a&gt; is available.
</description>
  </item>
  <item>
    <title>Assignment 3</title>
    <link>http://www.kenytt.net/spool/2006/02/24#1140830283</link>
    <description>
&lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst3&quot;&gt;Assignment 3&lt;/a&gt; is available.</description>
  </item>
  <item>
    <title>Demo version of Assignment 2</title>
    <link>http://www.kenytt.net/spool/2006/02/20#1140425786</link>
    <description>
A compiled executable version of &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst2&quot;&gt;Assignment 2&lt;/a&gt; is now available.  Download &lt;a href=&quot;/courses/csuf/2006/spring/465/download/assignment2.exe&quot;&gt;assignment2.exe&lt;/a&gt; to see how your program should work. 

&lt;p&gt;

My version needed 14 new lines of code:  a function to implement the vector cross product operation and some changes to the function &lt;code&gt;move_point()&lt;/code&gt;.
</description>
  </item>
  <item>
    <title>Assignment 2 update</title>
    <link>http://www.kenytt.net/spool/2006/02/19#1140329278</link>
    <description>
Some compilers may have trouble with &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst2&quot;&gt;Assignment 2&lt;/a&gt; because their standard library's &lt;code&gt;&amp;lt;math.h&amp;gt&lt;/code&gt; header files define &lt;code&gt;y0()&lt;/code&gt; and &lt;code&gt;y1()&lt;/code&gt; to compute the Bessel function.

&lt;p&gt;

To fix the issue, replace &lt;code&gt;y0&lt;/code&gt; and &lt;code&gt;y1&lt;/code&gt; with &lt;code&gt;y_0&lt;/code&gt; and &lt;code&gt;y_1&lt;/code&gt; or download the &lt;a href=&quot;/courses/csuf/2006/spring/465/code/assignment2.c&quot;&gt;updated version of assignment2.c&lt;/a&gt; 

&lt;p&gt;

Line 194 may cause some compilers to issue warnings:
&lt;pre&gt;	glutPostRedisplay;&lt;/pre&gt;
should be
&lt;pre&gt;	glutPostRedisplay();&lt;/pre&gt;
</description>
  </item>
  <item>
    <title>Assignment 2</title>
    <link>http://www.kenytt.net/spool/2006/02/18#1140252055</link>
    <description>
&lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst2&quot;&gt;Assignment 2&lt;/a&gt; is available.  Check back mid-week to download a compiled executable of a working solution.
</description>
  </item>
  <item>
    <title>Stop trying so hard!</title>
    <link>http://www.kenytt.net/spool/2006/02/17#1140157750</link>
    <description>
For those of you still scrambling to finish &lt;a href=&quot;/courses/csuf/2006/spring/465/assignments.html#asst1&gt;Assignment 1&lt;/a&gt;, I have a few words of advice:

&lt;blockquote&gt;
If you find yourself reading ahead in the &lt;i&gt;OpenGL Programming Guide&lt;/i&gt;, &lt;b&gt;STOP&lt;/b&gt;.  You're doing it wrong.
&lt;/blockquote&gt;

Believe it or not, I formulate assignments very carefully.  When the &lt;a href=&quot;/courses/csuf/2006/spring/465/outline.html&quot;&gt;Course Outline&lt;/a&gt; says &quot;Chapter 1 and Chapter 2,&quot; that's exactly what it  means.  You shouldn't be reading Chapter 5 or Chapter 12.  You don't need &lt;code&gt;glTranslate()&lt;/code&gt; or &lt;code&gt;gluPickMatrix()&lt;/code&gt; or any other OpenGL function that you haven't run into in Chapters 1 and 2.  (Don't worry, we'll cover those functions later on, when we get to them.)

&lt;p&gt;

In the meantime, here are the GL functions I called in my solution for Assignment 1:
&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;glBegin&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glClear&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glClearColor&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glColor3f&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glEnd&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glFlush&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glLoadIdentity&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glMatrixMode&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glOrtho&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glVertex3f&lt;/code&gt;
	&lt;li&gt;&lt;code&gt;glViewport&lt;/code&gt;
&lt;/ul&gt;

And technically, I didn't even need to bother with &lt;code&gt;glViewport()&lt;/code&gt;.

&lt;p&gt;

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.)
</description>
  </item>
  <item>
    <title>An easy way to run OpenGL programs</title>
    <link>http://www.kenytt.net/spool/2006/02/15#1140057517</link>
    <description>
Now that I've put you through the pain of &lt;a
href=&quot;/courses/csuf/2006/spring/465/assignments.html#0&quot;&gt;setting up your own
programming environment&lt;/a&gt;, I'll show you the easy way to run &lt;a
href=&quot;http://kenytt.net/courses/csuf/2006/spring/465/code/gears.c&quot;&gt;gears.c&lt;/a&gt;.

&lt;p&gt;

Grab a copy of &lt;a
href=&quot;/courses/csuf/2006/spring/465/download/igloo.zip&quot;&gt;igloo.zip&lt;/a&gt; and
unzip it somewhere convenient.  Run the program by typing&lt;pre&gt;
	&lt;b&gt;C:\igloo&amp;gt;&lt;/b&gt; igloo gears.c
&lt;/pre&gt;

Cool.  No compilation step, no moving headers and library files around, just type and go.  And in less than 230 Kb.

&lt;p&gt;

Igloo is a version of the &lt;i&gt;EIC C Interpreter&lt;/i&gt;, an Open Source project that seems to have gone &lt;a href=&quot;http://eic.sourceforge.net/&quot;&gt;missing in action&lt;/a&gt;.

&lt;p&gt;

Luckily, I saved &lt;a href=&quot;/courses/csuf/2006/spring/465/download/igloo.zip&quot;&gt;a copy&lt;/a&gt;, just for you.  I wish I'd saved a copy of the source code, too, but at least there are &lt;a href=&quot;http://www.itworld.com/AppDev/710/swol-0818-regex/&quot;&gt;lots of other C interpreters&lt;/a&gt;.

&lt;p&gt;

So what's the catch?
&lt;ol&gt;
	&lt;li&gt;The error messages generated by the interpreter aren't perfect.  But then again, neither are the error messages generated by Visual Studio.
	&lt;li&gt;I'm not sure how exact it is about implementing the ANSI C Standard, and can't find out because the web site is gone. There may be constructs that won't work.  But &lt;i&gt;gears.c&lt;/i&gt; is pretty complicated, and it works just fine.
	&lt;li&gt;It's a C interpreter, not C++.  Feel free to Google for one of those, and e-mail me if you find a good one.
&lt;/ol&gt;
</description>
  </item>
  </channel>
</rss>
