Originally posted by VL-Tone
Originally posted by OniLink10
Not sure if this has been asked already(Don't want to read through 16 Pages of Questions), but can anyone teach me about the 1-6 Bit Floating Point S,T Coordinates used for storing the Texture Locations in ROM? What I mean is Bytes 9-12 of the Level Geo's Vertices. I've tried Googling and searching the documentation, yet can't find anything.
I had a pretty hard time finding anything about the texture coordinates format, since it was only described by the n64 devkit documentation as the "10.5 format" and I couldn't find anything about it.
What I eventually discovered is that the format is based on the IEEE-754-1985 "Binary Floating-Point Arithmetic" format, but using only 16-bits, with 10 bits used for the significand ( or mantissa) and 5 bits used for the exponent (plus one sign bit).
Here's the wikipedia entry for IEEE-754-1985: http://en.wikipedia.org/wiki/IEEE_754-1985
This format is also known as "s10e5" and is used by some recent graphic cards (nVIDIA) on a low-level.
Check out this document describing a s10e5 c++ class definition: http://www.mrob.com/pub/math/s10e5.h.txt
I had found a pretty nice document which help me a lot to write a decimal-to-s10e5 converter for use with the TT64 level importer, but I can't find it... It's been a few months since I've worked on it so I couldn't really teach you how it works from the top of my head.
Woah, I was just looking at that Wikipedia Article while trying to figure out the data format!
So, if I did this correctly, 0x50DE(Used in Flatworld) translates to 0101000011011110 in Binary, which splits into 0 Sign, 10100 is 20, but the 5-Bit Bias is 15, so 20-15=5, so Exponent is 5, and 0011011110 is 2.22, and 2.22*10^5 is 222000. So, if the XYZ Coordinates are 0x2000,0x0000,0xDFFF(Used in Flatworld), then the S,T(I hear they are also known as U,V?) Coordinates are 0,222000, according to Flatworld. Hmm, I don't see how this relates to the X,Y,Z Coordinates. Maybe it has to do with the Texture Size? Hrm...
|