Show
Ignore:
Timestamp:
03/10/10 17:05:52 (3 years ago)
Author:
robert
Message:

From Sukender, "I've fixed positions for 3DS writer. Points in 3DS must be in world coordinates and I added what was missing.
And by refactoring a bit of code, I may have fixed some StateSets? related bugs (was ignoring StateSets? for osg::Groups).
I also added support for Billboard's points, so now "osgconv lz.osg lz.3ds" has an acceptable output. However, there is no rotation depending on billboards' axis, hence the notice "Warning: 3DS writer is incomplete for Billboards (rotation not implemented).". You may want to remove this notice (or lower the notify severity) if you feel 3DS doesn't have to handle such rotations.
The attached archive contains 3 files from 3DS plugin, against rev. 11162.

Please note there is still the textures issue for cow.osg. I guess it's because it's not a "flat, dummy and standard" texture in slot 0... That is to say the only thing the writer can handle at the moment. I guess I won't address this soon.
"
and

"I've detected and fixed another bug in 3DS writer: support for automatic splitting of meshes having >65k faces/points was buggy (was deleting faces).
Here is my four 3DS modified files (in a ZIP), against rev. 11193, including previous fixes AND Stephan's fix about relative filenames."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/3ds/WriterNodeVisitor.h

    r11056 r11194  
    6262        void        failedApply(); 
    6363        virtual void apply(osg::Geode &node); 
     64        virtual void apply(osg::Billboard &node); 
    6465 
    6566        virtual void apply(osg::Group &node); 
     
    135136        *  Fill the faces field of the mesh and call buildMesh(). 
    136137        *  \param geo is the geode who contain vertice and faces. 
     138        *  \param mat Local to world matrix applied to the geode 
    137139        *  \param listTriangles contain all the meshs faces. 
    138140        *  \param texcoords tell us if we have to treat texture coord. 
    139141        */ 
    140         void buildFaces(osg::Geode & geo, ListTriangle & listTriangles, bool texcoords); 
     142        void buildFaces(osg::Geode & geo, const osg::Matrix & mat, ListTriangle & listTriangles, bool texcoords); 
    141143 
    142144        /**  
     
    150152        *  Build a mesh 
    151153        *  \param geo is the geode who contain vertice and faces 
     154        *  \param mat Local to world matrix applied to the geode 
    152155        *  \param index_vert is the index used to build the new mesh 
    153156        *  \param texcoords tell us if we have to treat texture coord 
    154157        *  \param mesh is the mesh with faces filled 
    155         *  \return the place of the box in the vector. 
    156158        *  \sa See cutScene() about the definition of the boxes for faces sorting. 
    157159        */ 
    158160        void 
    159         buildMesh(osg::Geode        &    geo,  
    160                   MapIndices        &    index_vert,  
    161                   bool                   texcoords,         
     161        buildMesh(osg::Geode        &    geo, 
     162                  const osg::Matrix &    mat, 
     163                  MapIndices        &    index_vert, 
     164                  bool                   texcoords,        
    162165                  Lib3dsMesh             *mesh); 
    163166 
     
    193196        typedef std::map< osg::ref_ptr<osg::StateSet>, Material, CompareStateSet> MaterialMap; 
    194197 
     198        void apply3DSMatrixNode(osg::Node &node, const osg::Matrix & m, const char * const prefix); 
    195199 
    196200        bool                                _suceedLastApply;