Skip to content

Interactive Vehicle Viewer ​

Drop vehicle XML files or click to select
Build Options

How it works ​

  1. Parse sample_vehicle.xml
  2. Resolve component definitions and mesh files
  3. Assemble each body
  4. Render with Three.js
ts
const vehicle = parseVehicleXml(text);
const assembler = new VehicleBodyAssembler(resolver);

for (const component of body.components ?? []) {
  await assembler.appendComponent(component);
}

const object = assembler.build();

INFO

For simplicity, this demo only resolves basic blocks, wedges, pyramids, and inverse pyramids. No meshes are resolved.

Sample vehicle XML
sample_vehicle.xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<vehicle data_version="3" bodies_id="1">
  <authors/>
  <bodies>
    <body unique_id="0">
      <components>
        <c>
          <o sc="6">
            <vp x="-8" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-7" y="2"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,-1,0,1,0,1,0,0" sc="5">
            <vp x="-9" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-9" y="1"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,-1,-1,0,0,0,1,0" sc="5">
            <vp x="-9"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-8"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,1,0,1,0,-1,0,0" sc="5">
            <vp x="-7"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-7" y="-1"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,1,1,0,0,0,1,0" sc="5">
            <vp x="-7" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-8" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-9" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-5" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-4" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-3" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-4" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-4" y="-1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-4"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-4" y="1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp y="2"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,1,0,1,0,-1,0,0" sc="5">
            <vp x="1" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="1" y="-1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="1" y="1"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,1,1,0,0,0,1,0" sc="5">
            <vp x="1" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp y="-2"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,-1,-1,0,0,0,1,0" sc="5">
            <vp x="-1" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-1" y="-1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="-1" y="1"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,-1,0,1,0,1,0,0" sc="5">
            <vp x="-1" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="3" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="3" y="-1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="3"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="3" y="1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="3" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="4" y="2"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,1,0,1,0,-1,0,0" sc="5">
            <vp x="5" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="5" y="1"/>
          </o>
        </c>
        <c d="02_wedge">
          <o r="0,0,1,1,0,0,0,1,0" sc="5">
            <vp x="5"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="4"/>
          </o>
        </c>
        <c d="05_wedge_2">
          <o r="0,0,-1,-1,0,0,0,1,0" sc="9">
            <vp x="4" y="-1"/>
          </o>
        </c>
        <c d="05_wedge_2" t="7">
          <o r="0,0,-1,-1,0,0,0,1,0" sc="9">
            <vp x="5" y="-2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="7" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="7" y="1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="7"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="7" y="-1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="7" y="-2"/>
          </o>
        </c>
        <c d="05_wedge_2">
          <o r="0,0,-1,1,0,0,0,-1,0" sc="9">
            <vp x="8" y="1"/>
          </o>
        </c>
        <c d="05_wedge_2" t="7">
          <o r="0,0,-1,1,0,0,0,-1,0" sc="9">
            <vp x="8"/>
          </o>
        </c>
        <c d="05_wedge_2">
          <o r="0,0,1,1,0,0,0,1,0" sc="9">
            <vp x="9"/>
          </o>
        </c>
        <c d="05_wedge_2" t="7">
          <o r="0,0,1,1,0,0,0,1,0" sc="9">
            <vp x="9" y="1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="10" y="1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="10" y="2"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="10"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="10" y="-1"/>
          </o>
        </c>
        <c>
          <o sc="6">
            <vp x="10" y="-2"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-10" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-9" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-8" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-7" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-6" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-5" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-4" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-3" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-2" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="-1" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="1" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="2" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="3" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="4" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="5" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="6" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="7" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="8" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="9" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="10" y="-3"/>
          </o>
        </c>
        <c>
          <o bc="4091B4" sc="6">
            <vp x="11" y="-3"/>
          </o>
        </c>
      </components>
    </body>
  </bodies>
  <logic_node_links/>
</vehicle>