Jim Wilson writes:

> Michael Selig <[EMAIL PROTECTED]> said:
> 
> > Thank you for this explanation.  It reminds me now of some past comments 
> > from you along these lines.
> > 
> > I was hoping for the answer "use this code to convert the files", but 
> > things are not so simple unfortunately.
>  
> If you are handy at scripting you might be able to take the ac3d file saved
> from ppe and clean it up. 


This might make a better converter then PPE

/* convert from .mdl to .ac format
 * 
 * Cygwin compile command
 * c++ -O -o mdl2ac convert.cxx -lplibssg -lplibsg -lplibul -lopengl32 -lgdi32 -lwinmm
 *
 * This assumes that the model to convert is in a subdirectory 'model'
 * and the textures are in a subdirectory 'textures'
 * This is the commom directory structure for FS2000 models
 *
 * Norman Vine [EMAIL PROTECTED]  12-17-2002
 */

#include <iostream>
#include <plib/ssg.h>

int main(int argc, char **argv)
{
    if( argc !=3 ) {
        std::cerr << argv[0] << " Expecting 2 args: <input model> <output model>\n";
        return 1;
    }
    std::cerr << "ModelPath: ./model" << std::endl;
    std::cerr << "Texturepath: ./texture" << std::endl;
    ssgModelPath   ( "model" ) ;
    ssgTexturePath ( "texture" ) ;
    ssgEntity *my_obj = ssgLoadMDL ( argv[1] ) ;
    ssgModelPath   ( "./" ) ;
    ssgSaveSSG ( "tmp.ssg", my_obj ) ;
    ssgEntity *my_obj2 = ssgLoadSSG ( "tmp.ssg" ) ;
    std::cerr << "Optimizing " << std::endl;
    ssgFlatten  ( my_obj2 ) ;
    float *tol = NULL;
    ssgArrayTool ( my_obj2, tol, true ) ;
    ssgStripify ( my_obj2 ) ;
    std::cerr << "Saving: " << argv[2] << std::endl;
    ssgSaveAC ( argv[2], my_obj2 ) ;
    return 0;
}


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to