Matrix Multiply

March 7, 2008

I’ve been doing a lot of 3D programming in my spare time. Though parts of it were spent doing mostly in research and study.  Take for example the time I spent going through bits and pieces of information figuring out the details of Matrix Transformations, you probably know and can probably count the number of nights spent on it.

Anyway, with the help of a friend who badly needed a Matrix Transform lib written entirely in C, he’s trying not to borrow code from the Web so as not to get a lower grade, we finally sat down and wrote probably the shortest quick-n-dirty version of the Matrix Transform ever coded.

With most of the basic Transform functions squared-away, I finally got it added on top the OpenGL engine wrapper.  The first test was basically loading a 3DS mesh file into the world before rotating, scaling and translating it to a location. That test went very well, the Matrix Transform worked right away with no hiccups. I thought the model will come out mangled in knots, but somehow, the model got rotated, scaled and translated as planned.

The next test will start soon, though the elements needed to get the test going aren’t there yet. The B3D loader is still 50% complete and the slerp() function is yet to to coded. For some unknown reason, I somehow got hooked into B3D format mainly because of its completeness and simplicity.

 The B3D loader is LGLP’d and is available on SF.net.


The Shading of Hair

December 20, 2007

Been reading tons of stuff about hair, mainly papers from Kajiya and the much later presentation from Thorsten Scheuermann (ATI Research).

From goofing around with the equations to finally buckling-down to implement the attempt using simple tools like Blender to create the geometry and then export the vertices to a render tool like RenderMonkey, I thought I had all the materials ready. Unfortunately, the geometry I generated did not have the tangent data which was required in the fragment shader. To state it simply, I was royally screwed.

What I basically had was the position, normal and some texcoord data. Plus two textures for skinning and masking. With that on the table, the only option was to re-think the phenomena and re-state the formula according to what was available.

The first try failed, it came out just like an ordinary texture splatted on a polygon.

The second was even worse, the specular made it like plastic.

I’ll try again this weekend.

 

ref: Martin Koster, J¨org Haber, Hans-Peter Seidel


Utility

November 28, 2007

Finding a solution to a social problem, specifically human behavior can be trivial, yet so obscure at the same time. The solution is not derived via quantitative means alone, perhaps it has something to do with how consumers define utility.

And so I continued my search to define what is utility in terms of our product line. Is it the product itself that consumers buy, or is it satisfaction derived from the use of our products define what utility is? If it is true, then how do I connect the dots in such a way the messaging is always in tune to its utility?

3D Game

After painfully emerging from the great unknown in figuring out the latest-n-greatest GPU shaders, it seems that the next exercise would be to mimic a commercial released 3D game, simple enough to do yet not too easy to be considered nihil. New shader features implementing skin shading via subsurface scattering and cloth shading, another is hair shading where hair is affected by several forces acting on it.

Two gametypes came up right away, the first was Taekwondo (TKD), the way of fast kick and punch, made a good impression. Modeling the terrain is simple, a scene having a place where two opponents fight. The actor having several animated sequences, often derived from standard Taekwondo forms. The objective is to implement said features to an actor with proper skin shading, good enough to render realistic skin showing the oily (sweaty) part of skin. Facial expressions are tackled as well, making sure the proper vertices are shaded to show the correct expression. Cloth shading referring to the kimono (Grandmaster Uniform) should show cloth tension and gravity. The mechanics of hair will also be studied and implemented if possible, yes hair mechanics is hard.

The second gametype is to basically resurrect my favorite Apple II game that we played, known as Karateka. This is basically a fallback of the first, in the case TKD turns out to be complicated.