How to use bones and skeletons in mesh XML?

lrt505

Light Rail Trainz
Hello. I am going to make animation meshes but GMax or 3Ds Max is not easy to operate. Therefore, I would like to use sketchup then modify the XML. However, the problems happen when I tried to use bones.

Suppose in the following test, I want to have the triangle 5 meters above the ground. I set the height in the bones but not individual vertices. However, it does not work.

Code:
<trainzImport>
  <version>1</version>


  <mesh>
    <name>m.test</name>


    <triangles>
      <triangle>
        <materialId>0</materialId>
        <vertex>
          <position>0.0000,0.0000,0.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          [COLOR=#0000ff]<boneId stream="0">0</boneId>[/COLOR]
          <blend stream="0">1</blend>
        </vertex>
        <vertex>
          <position>0.0000,1.0000,0.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
        <vertex>
          <position>1.0000,0.0000,0.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
      </triangle>
      <triangle>
        <materialId>0</materialId>
        <vertex>
          <position>0.0000,0.0000,0.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
        <vertex>
          <position>0.0000,0.0000,1.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
        <vertex>
          <position>1.0000,0.0000,0.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
      </triangle>
      <triangle>
        <materialId>0</materialId>
        <vertex>
          <position>0.0000,0.0000,0.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
        <vertex>
          <position>0.0000,1.0000,0.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
        <vertex>
          <position>0.0000,0.0000,1.0000</position>
          <normal>0.0000,0.0000,-1.0000</normal>
          <texcoord>0.0000,0.0000</texcoord>
          <boneId stream="0">0</boneId>
          <blend stream="0">1</blend>
        </vertex>
      </triangle>
    </triangles>
  </mesh>
  
  <skeleton> 
    <bones>
      <bone>
        [COLOR=#0000ff]<id>0</id>   [/COLOR]
        <name>b.tri1</name>
        <parentName></parentName>
        <position>0,0,[COLOR=#ff0000][SIZE=5][B]5[/B][/SIZE][/COLOR]</position>
        <orientation>0,0,0,0</orientation>
      </bone>
    </bones>
  </skeleton>
  
  <animations>  
    <animation>   
      <name>test</name>
      <frameRate>30</frameRate>
      <useLocalSpace>false</useLocalSpace>
      
      <animationTracks>
        <animationTrack>
          <targetName>b.tri1</targetName>
          <keyFrames>
            <keyFrame>
              <position>0,0,0</position>
              <rotation>0,0,0,0</rotation>
            </keyFrame>
          </keyFrames>
        </animationTrack>
      </animationTracks>
      
    </animation>
  </animations>


  <materials>
    <material>
      <name>default_material_m.notex</name>
      <id>0</id>
      <ambient>1.0,1.0,1.0</ambient>
      <diffuse>1.0,1.0,1.0</diffuse>
      <specular>0.0,0.0,0.0</specular>
      <emissive>0.0,0.0,0.0</emissive>
      <shine>0.32</shine>
      <opacity>1.0</opacity>
      <twoSided>true</twoSided>
    </material>
  </materials>


</trainzImport>

The result is as follows. (suppose I want the triangle to be 5 meters high)

7752375432_2e6478e8e7_o.png


What is the problem? Thank you.
 
Back
Top