Quote:Original post by CyberSlag5k
I've never even seen #QNAN before, and the e###'s make me a little concerned. Plus, none of these values should be negative (although sometimes certain exporters break that convention. Does the e stuff suggest I should be using doubles? I think I might anyway, just to be safe. So yeah, these values are garbage, I think, but the rest of my stuff reads in ok.
#QNAN means that the data read in doesn't represent a floating point number (NAN == Not A Number). The e### stuff is nothing to worry about. If you do float f = 10000000.0f; and then try to cout it, you'll get something with an exponent most likely.
Quote:Original post by CyberSlag5k
normVector.setVector(buffer[0 + (i*4)], buffer[4 + (i*4)], buffer[8 + (i*4)]);
If buffer is an array of floats, then you should be adding 1 each time, not 4. The number is the index in "units" (floats in this case), not bytes (unless buffer is an array of bytes of course).
So, if buffer is an array of floats, the line should be: normVector.setVector(buffer[0 + (i*4)], buffer[1 + (i*4)], buffer[2 + (i*4)]); and similarly for the other lines (3+(i*4), etc).
Quote:Original post by CyberSlag5k
EDIT: It would be nice to be able to check my data to see what the values should actually be. I've tried a few hex viewers I found on download.com but they just came up gibberish. Anyone know a good (free) application for viewing binary files? The data is stored as floats, if that makes any difference.
I use AXE quite happily.
Quote:Original post by CyberSlag5k
Another question, is there a maximum size for these things? I have some pretty gigantic files. Since I'm dynamically creating the buffer/array of floats, I should be able to load in files until I run out of available memory, right?
There's not really any maximum size, But you'll have extreme problems going over 1Gb or so. I've allocated 700Mb in one go before (I have 512Mb RAM). It works, but the call to new takes 2 or 3 minutes (litterally).