Wii Opera SDK - New Mesh Format
Friday, July 18th, 2008Most of the code migration to the new version 3.x of the Wii Opera SDK is complete. One of the big changes is the format for mesh arrays. The format is as follows:
Mesh[triangle][x1,y1,z1, x2,y2,z2, x3,y3,z3, r,g,b, texture, shading]
Mesh[triangle][x1,y1, x2,y2, x3,y3, r,g,b, texture, shading]
As you may notice, this new format opens the door to mesh arrays with mixed type triangles, meaning that both textured and flat-shaded triangles can inhabit the same mesh. Let me take a moment to explain what the two added values are:
texture: This refers to the element number of a texture image array, which if defined elsewhere. By placing a negative value here, it flags the SDK to use the RGB colors instead of a texture. If a non-negative value is given but no texture array is passed to the SDK, the triangle will also be flat-shaded.
shading: This is more of an internal value than anything, used by shading and fading. It contains a value in the interval [-1, 1]. This value can also be set manually to add brightness effects to the triangle.
I will be updating the documentation and further migrating code over the next few days. All example webpages are updated to make use of the new code already.