O-Town Graphics

Tuesday, April 25, 2006

Welcome to O-Town Graphics

My name is Matthew, I'm a 23 year old professional graphics programmer in downtown Orlando. Orlando is called "O-Town" and I just thought hey let that be the subject of my new Blog. Orlando has an interesting rep - we all know that EA is a slave driver so I'm rather happy I do not work for them. Although it is a tourist town, downtown Orlando has sort of a Seattlesque feel to it (sans the coffee addicts and higher IQ)... because well, there is seems to be a sort of grunge look!

I work for a company that develops products for character animation, specifically a product which helps students learn sign language (especially deaf students) - and geared and funded by an educational grant. We also receive other grants, so I suppose you could say we are primarily a research company.

My first entry will be a tutorial I wrote for those who feel the passion to understand how to effectively find the collision between a triangle and cube.


The first thing you notice about 3D graphics is that things often take a lot longer to learn. It is simply much more involved when you are dealing with the 3rd dimension. While some things are easier, other things are harder. It all depends on what you’re trying to accomplish.

The latest developments in graphics come so quick, it is going to force me to become a mathematician. For example, most 3d graphics can be done using matrix and vector math. As you may know, the matrices are 4x4 which encapsulate affine transformations including skew, scaling, perspective, translation, reflection, and rotation. These are done using 4-dimensional coordinates, but the 4th coordinate (the perspective divide) is fairly easy to conceputalize.

Quaternions are an extension of complex math that deal with hyperspheres, where the unit quaternion encapsulates an orientation, but the operations on quaternions allow for things such as the rotation of a point about an axis of rotation with a given angle. SLERP is a term used to refer to spherical linear interpolation, allowing a smooth interpolation between two orientations (say, like being able to smoothly reorient a skeletal model's arm from one pose to another). I've learned most of all I need to know about quaternion math.

Another branch, which is supposed to simply math of line segments, is called Plücker coordinates. Plücker coordinates are able to take a line-segment and turn it into a 6-D point. These simplify operations for plane-plane intersection, line to plane intersection, and line to polygon intersection. These are useful for speeding up operations for intersecting polygons with rays, such as when you are doing portal clipping. This is because there are algorithms which can take a piece of polyhedra and slice it into a plane. And portal regions are usually convex polyhedra. I have no clue how Plücker coordinates work, currently. Many implementations do this using vector algorithms only, which require you to do additional checks and work.

Finally, the latest, which is much more encompassing, is Geometric algebra. This apparently is a complete new math, a math which apparently encompasses linear, vector, and complex algebra in a way of being able to handle dealing with geometric concepts easily. When I first learned quaternion’s and how they kept on extending and simplifying things by extending dimensions, I wondered well if you can have an orientation encoded as 4-dimensions, can't you tack on more dimensions to somehow handle the position as well as the orientation? Indeed, apparently, geometric algebra has a construct that not only encompasses the orientation of a geometric "thing", but also a position. I'm not sure it does this by simplify tacking on a dimension, but it is a new algebra which defines new terms and ways of thinking of things.

You ever try to do physics without calculus? Sometimes the tricks necessary in standard algebra to do what is necessary is nearly impossible without calculus. Calculus defines the tools necessary to handle the incongruities at things where the limit approaches 0. In fact, these nasty cases are hard to program for if you didn't use the proper math construct, the proper tools, to do the job. Same with geometry. There are nasty things that occur with vertical lines (OH no, division by 0), leading to coordinate-free approaches, i.e. purely a vector approach. Yet still, there are other nasty things - for example, gimbal lock, a way of losing an axis of freedom by using Euler angles, all derived from vector algebra. These "nasties" destroy calculations, force you to take steps to avert it by chasing schemes. There are many times where when your using a simpler math construct, you are dealing with hidden “gotchas” and singularities that can "nastify" the implementation of a graphic algorithm at times.

Case in point, geometric algebra has been given credit now to one of the latest lighting techniques that is supposed to be beyond spherical harmonics, in combination with wavelets.

Check out this GDC demo -


Luckily, as I am very new to this field, I’m glad this technology isn’t yet required for what we do. It is always useful to aspire to push the envelope and be aware of where the industry is heading. In addition, the size of your paychecks often correlate to your level of aspiration :)


Post a Comment

<< Home