Tuesday, December 28, 2010

This Week In DigiPen: Epilogue

Well, as you may have noticed, that didn't work out quite as planned.  DigiPen demands much time, nearly all of it during certain weeks of the semester (week 7, week 8, and week 14 in particular).  This semester was particularly demanding, though I'm not entirely sure why.

It's very different not having a game team.  Having a team means you have people you can rely on - and that you have someone relying on you.  That's a driving factor - it keeps you rolling in good times and in bad.  It gives you someone to talk to about the issues you're having in other classes.  You have team meetings with Check-In for your personal soapbox.  It makes you aware of problems you have and get them off your chest.

A quick aside about Check-In and what it is.  If you know what it is, feel free to skip the italics.  Check-In is a protocol for team meetings where you go around to each person and they say how they feel in a few simple words: "I feel..." followed by glad, mad, sad, or afraid, then what is triggering that feeling (i.e. I feel sad that I didn't come through with my weekly DigiPen updates for my blog).  After talking about their feelings, the person then states if they are in or out of the meeting - if they're not going to be productive, they may as well take the time off to relax or get caught up on some other work.  Finally, the team responds to that member's decision ("Welcome" for in, "Thank you" for out).  If you're out, you take your leave then.

Overall, I think my This Week In DigiPen project would have worked better if I had used a format similar to Week 7 and Week 8.  It was quick, simple, and didn't require much time or effort.  It was a sort of check in that got the point across, but, by the time I discovered this format, I had burned out.

So, let's move on to some promises to keep.

CS300 - Points are not Vectors
Way back when, I promised that I would show off my first shiny graphics assignment, which I thought I had completed to the fullest.  Turns out that I had a lingering bug that stuck through my next two assignments.  It slipped by in my first assignment (lighting), but it became obvious in the bump mapping assignment that my light was following my camera in position.  However, the direction was fully correct.

The eye looks at the origin with a spot light above pointing at the origin as well.

The eye moves past the origin, and the light follows incorrectly, shining in the same direction as before.

The eye turns around to face the origin, and the light points in the correct direction.
I tried for the longest time to figure this out.  I showed it to person after person with no luck.  Finally, one of my fellow students realized that I had made a very simple mistake.  In 3D graphics, we use 4D matrices to transform points and vectors because math is a magical thing.  It allows us to distinguish between points (translation dependent) and vectors (translation independent).  Had I thought of this simple distinction between the two, the answer would have been obvious.

For example, let's take the origin.  As a 3D point, that would be at (0, 0, 0).  In 4D, we add a 1 at the end of that, so (0, 0, 0, 1).  This extra 1 allows us to translate that point wherever it needs to go.  Let's say we have another point P at (1, 2, 3, 1), and we want to draw a vector V from the origin to our point P.  That's the difference between P and the origin, so V = P - O = (1 - 0, 2 - 0, 3 - 0, 1 - 1) = (1, 2, 3, 0).  This 0 at the end means we ignore any translation that may be applied to the vector, thus it is translation independent.

Now then, our light has some translation away from the camera, right?  At least, that's what we want.  So, if our light is moving with the camera, that means it's not translating away from the camera.  If we don't have a translation, then our light is translation independent.  If the light is translation independent, then it's position must be a vector, not a point.  That's a problem.  In fact, that was my problem.  So, what's the difference between a point and a vector in 4D?  That last element:  (x, y, z, 1) is a translatable point, (x, y, z, 0) is a translation independent vector.

So, now that we've got that out of the way, let's see some shiny graphics.

Some simple Phong lighting.

Now with normal mapping generated from a height map (texture turned off for emphasis).

Now with shadows!  Note the cone under the torus' shadow for maximum fanciness.

Reflection and refraction using cube mapping.

Alright, that's enough of graphics.  Now on to what DigiPen is really about - the games.  Blankie is launched, so you may as well go play it.  It hit the scope I wanted it to (a single level that's a bit long), and overall I'm very happy with it.

At this point, I'm rambling, so I'm just gonna cut it off here - goodbye semester.  Onward to my final semester!

No comments:

Post a Comment