This is a easy to use Lightwave szenefile loader. It provides you with all parameters of objects, lights and (not yet) cameras defined in the scenefile. ------------------------------------------------------------------------------- Written 2006 by Felix Weißig, thesleeper@gmx.net, http://www.otaco.de Version: 0.1 This is GPL free software. Read the gpl.txt located next to this file or visit http://www.gnu.org/ for more information. ------------------------------------------------------------------------------- Some usefull facts: 01. To create an instance use following constructors: LWS_SceneLoader( ) LWS_SceneLoader( std::string filename, unsigned int flags ) LWS_SceneLoader( std::string filename, unsigned int flags, int verbose ) Verbose is set to 1 by default. 02. You can determine what to load with following flags: LW_OBJECTS, LW_LIGHTS, LW_CAMERAS, LW_EVERYTHING Examples: LWS_SceneLoader("testscene.lws", LW_EVERYTHING ); LWS_SceneLoader("testscene.lws", LW_LIGHTS | LW_OBJECTS, 1 ); 03. You can merge/add several scene files with the addFile method like this: addFile ( std::string filename, unsigned int flags ) addFile ( std::string filename, unsigned int flags, int verbose ) 04. Verbose = 1 prints a message if an object/light/camera is created. Verbose = 2 prints the properties of an object/light/camera too. 05. You can get the basename ( "/myLWSdir/objects/teapot.lwo" -> "teapot" ) of an object with the getBasename() methode. The path to to the file you can get with getPath(). If you want to have relative pathes within the *.lws file, you have to set the working directory in Lightwave located in the "General Settings". 06. Every object, light or camera has its own unique id. You can get this id with the getId() method. The id is seperat for objects, lights and cameras. If you load one object more than ones and need a unique string as name for it in your application, you can use the getUniqueName() methode. This works with lights and cameras too. For example: an object with name "teapot" and the id "25" will get the unique name "teapot_25". 07. All angles are stored in rad. All distances are stored in meters. 08. Maybe you have to invert the angle components in your application. 09. The lighttype index means: 0 = distantLight 1 = pointlight 2 = spotlight 3 = linearlight 4 = areaLight 10. The lighttype index means: 0 = disabled 1 = raytraced 2 = shadowmap (only available with spotlights) 11. The default view direction of Lightwave is ( 0, 0, 1 ). In most scenegraphs like openSG or performer the default view direction is ( 0, 0, -1 ). The coordinate system in Lightwave looks like this: +z (front) | -x --y-- +x | -z (back) Thats different from most scenegraph coordinate systems;