Md2 model loads with reversed normals

I can't figure out what is wrong with this issue.



I use the same basic code for loading md2 files similar to the examples in JME, and all models (including example models like drfreak.md2) end up inside out.  It seems like their normals are inside out or something, because if I have no culling, it works, but the lighting is inverted (dark areas are bright and bright areas are dark).



Here is the loading code i use:



   public static Node loadMd2Model(String file)
   {
      URL modelToLoad = null;
      
       if (modelToLoad == null) {
            modelToLoad = SimpleGame.class.getClassLoader()
               .getResource(file);
        }
      try {
            Md2ToJme C1 = new Md2ToJme();
            ByteArrayOutputStream BO = new ByteArrayOutputStream();
            C1.convert(new BufferedInputStream(modelToLoad.openStream()), BO);
            Node r1 = (Node)BinaryImporter.getInstance()
               .load(new ByteArrayInputStream(BO.toByteArray()));
            //r1.setLocalScale(.1f);
            if (r1.getChild(0).getControllers().size() != 0)
                r1.getChild(0).getController(0).setSpeed(20);
           
            return r1;
        } catch (IOException e) {
            logger.log(Level.SEVERE, "Failed to load Md2 file", e);
        }
        return null;
   }



I don't change the cull state, and this still happens.  Any suggestions?

I had the same problem, md2 and md3 models have in nearly all program (funnily enough not in all) reversed normals, I also tried to import the models in blender flip normals and export them again, but this didn't solved the problem anyway (neither "no v.normal flip").



now my work around looks like this:

*use blender to import md2 Models,

*export into a xml File (with hevee's export script) and chose "morph target animation"

*and load them with XMLtoBinary into JME



more info about xml to jme:

http://code.google.com/p/jmexml/

http://www.jmonkeyengine.com/wiki/doku.php?id=importing_models_from_blender&s=xml