I have spent the past couple of weeks developing a lightwave model renderer/loader, and I have now finally completed it. There are still certain key features that need to be implemented, such as texture loading and such, but those will all be added in due time.
Currently, the LWO loader is branched off in to one class, the LWOLoader class Here's all the details about it:
Sorry to say, however, that the code for this loader will not be released for a little while, until it's completely done. If you have any questions, feel free to ask. If you would like to use this loader, I might be able to work something out with you.Code:/**** ****\ * * * LWOLoader.h * * * * Designer/Programmer: * * Jeff Verkoeyen * * * * Current Version: * * 1.01 ~September 02, 2003~ * * * * Required files for successful compilation: * * LWOLoader.h | LWOLoader.cpp | LWODef.cpp | Logger.h | Logger.cpp * * * * Purpose: * * To load a LWO (LightWave Object) File, and to have all of the data * * accessible for drawing. * * * * Classes: * * LWOLoader- Holds all the data for the LWO file and also handles * * loading. * * * * Macros: * * FLIP- Flips data using the two functions in the LWOLoader class. * * Used for switching the endian format around if it is backwards. * * RESIZE- A very handy macro for resizing a class or structure. C++ * * does not like it if you use realloc on its classes/structs, so * * use this macro instead. NOTE: Do NOT use it on a class/struct * * that is constantly getting bigger, or you'll have to wait a * * long time. * * * * Version: * * 1.0- * * ~Released~ * * August 29, 2003 * * ~Updates~ * * First release. Able to load and display models. No texture * * loading is currently supported. * * ~WishList~ * * Texture Loading, more supported tags, no memory leaks. * * 1.01- * * ~Released~ * * September 02, 2003 * * ~Updates~ * * Fixed a minor bug with the POLS chunk, where it would * * overwrite the name of the sub-chunk and cause it to * * think that a FACE sub-chunk was actually a PTCH * * sub-chunk. * * * * * * ©2003 The Developer's Alliance (TDA) * * This class/code is property of Jeff Verkoeyen. If you would like to * * modify or use this code in any way, please contact Jeff Verkoeyen * * beforehand. * * Email: firstname.lastname@example.org * * * \**** ****/
Mind you, this class was completely started from SCRATCH by me, the only help I got was the file format from the SDK site, from that I had to build the class to load the files in. Also included with the loader is a simple logger which helps tremendously with the debugging process.
Here's a screenshot of a sample model that was loaded with my LWO class: