Programming Mood Shadings

Since mood shadings have now become a central concern in the design, it is necessary for me to nail down exactly what has to be done to get them working.

Utilizing conventional tools
The obvious approach is to integrate one of the many face generator programs into Siboot. This, however, is not so easy to do. All of these programs will generate a static jpg output, but animated output is somewhat less common. And all of the programs I have seen are customized to operate under Windows. That pretty much throws out the Mac, a sacrifice I am loth to make. 

Moreover, linking this code into our Java code will be a major obstacle. Almost all Windows game programming is done in C#, so it is highly likely that they are all configued as C# libraries. Now, it should be possible to import those libraries outside of Java, but I am terrified of the complexity of this approach: it will require a specialist programmer, everything will be completely dependent upon that specialist, and it will brittle. My guts scream in protest against such a strategy.

We can’t use these tools offline to produce animation sequences that can be stuffed into the program as a resource, as we’re talking about many, many gigabytes of data to do so. 4 characters times 20 basic facial expressions times 21 mood shadows times 100 frames at, say, 300h x 500v adds up to 25 gigabytes — and that’s a bare-bones approach. But perhaps we can pull a few tricks to squeeze in…

A possible solution
I’ll cut to the chase: I have an idea that might solve our problem. Let’s start with the existing primitive Face Editor. We need three head rotations to get good mood shadings: roll, pitch, and yaw. Roll is the easiest to do: it’s just a 2D rotation of the face in Java. Pitch and yaw are the killer problems, because they require proper 3D computations. However, there’s a possible simplification available. Since we’re considering only small angular changes for pitch and yaw, we could use linear interpolation. For each of the four faces, Alvaro would create a master version of the face that is looking straight toward the camera, then 8 other versions in which the face is either pitched or yawed ±10º off center. We could easily map the mobile elements of the expression onto this face using simple trigonometric transforms. I think we could animate the process by interpolating values — but I’m not so sure here. 

Further thoughts
It is also possible to make standard graphical transforms the permit pitch and yaw:

Nine Faces

When combined with face tilt, we can get a lot of effect. These faces are all made with a transform called “Perspective”, which is built right into the Java Graphics Library. We can enhance these effects with the use of shading:

MoodShadingPlus Shading

Yes, this is all quite primitive, but could it be used to meet our needs?