Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Got some problems with my exporter

This topic is 2112 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I don't understand why this code snippet would

produce a series of zeros, there are vertexes located

above the ground plane.

<mesh>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<x>0.00000</x><y>0.00000</y><z>0.00000</z>
<normals><x>0.00</x><y>0.00</y><z>0.00</z>
</normals>
</mesh>

 

 ptree& stored = frame.add("mesh", "");   
  char buff[10];
  sprintf (buff, "%d", mesh[0]);
  MessageBoxA(NULL, buff, buff, NULL);
  // 24 floats 3 floats per group 8 vertices
  for (int i = 0; i < mesh[0] ; i++)
  {
        char v[10];
        sprintf (v, "%2.5f", mesh[i+1]);
        
 
    
        switch (i%3) {
        case 0:
            frame.add("mesh.x", v);
            break;
        case 1:
            frame.add("mesh.y", v);
            break;
        case 2:
            frame.add("mesh.z", v);
            break;
        }
  }
 

Share this post


Link to post
Share on other sites
Advertisement
Not knowing what ptree is it what it does makes this a bit of a guess but if ptree is simply storing 'v' for each call of frame.add then the output for all calls to this routine would be the final contents of v maybe?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!