I need to convert some IBM formatted floating point data from a binary file so I can read into Java3D. This uses a different number of bits for the exponent and mantissa than is used by the IEEE representation. Can anyone point me at code or a tutorial on bit-twiddling in Java?
Buried inside Xj3D are some classes which might help you. Its a FloatPacker class(src/java/org/web3d/vrml/export/compressors/FloatPacker.java)
It allows you to encode/decode a float using a certain number of exponent and mantissa bits. It also has contants for the biases used but I've never needed to change that. The code is based off work from Game Developer magazine.
You can get it from CVS via:
http://www.xj3d.org
Or I can send you the file directly. I'm likely going to put this and some other compression tools into another library soon, but right now its in the bottom of Xj3D. -- Alan Hudson President: Yumetech, Inc. http://www.yumetech.com/ Web3D Open Source Chair http://www.web3d.org/TaskGroups/source/
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".