Workflow from XML to a track

Arkady English <[email protected]>
Newsgroups gmane.games.torcs.general
Message-ID <CAH4xcLovdtXHcjEvFz71c=_+pYamX3_NbthZVdE2Xwh=2Q=X2w@mail.gmail.com>
Hi everyone.

Back in July I posted that I was having difficulty converting XML to a
track.

I tried what was suggested, but realise I didn't give much information and
focussed on the meat and bones of the project I was actually doing. I'd
like to try to get trackgen working. I've attached a sample track XML and
the console output for it.

Console output:
++++++++++++ Track ++++++++++++++
name = test
author = Vicente Marti [node to self: I need to change this line]
filename = tracks/test/example_track/example_track.xml
nseg = 323
version = 4
length = 1265.484131
width = 14.000000
pits = 0
XSize = 571.576416
YSize = 217.999969
ZSize = 0.000000
Delta X = 0.000549
Delta Y = -0.001114
Delta Z = 0.000000
Delta Ang = -0.000006 (-0.000318)
=== Indices array size =19790
=== Vertex array size = 59370
=== Tex coord array size = 39580
=== Indices really used = 7454


At this point I get the Windows "trackgen has stopped working, Windows is
searching for a solution..."

The XML is attached.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
Torcs-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/torcs-users
example_track.xml (text/xml, 19.7 KB)
<?xml version="1.0" encoding="utf-8"?>
<!--
file : test.xml
auto generated : by Track Editor
version : v 0.6.0 24/4/2005
copyright : (C) 2005 by Charalampos Alexopoulos
email : 
-->
<!--
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-->
<!DOCTYPE params SYSTEM "../../../src/libs/tgf/params.dtd" [
<!-- general definitions for tracks -->
<!ENTITY default-surfaces SYSTEM "../../../data/tracks/surfaces.xml">
]>


<params name="test" type="param" mode="mw">
<section name="Surfaces">&default-surfaces;</section>
<section name="Header">
<attstr name="name" val="test" />
<attstr name="category" val="road" />
<attnum name="version" val="4" />
<attstr name="author" val="Vicente Marti" />
<attstr name="description" val="Test track" />
</section>
<section name="Graphic">
<attstr name="3d description" val="test.ac" />
<section name="Terrain Generation">
<attnum name="track step" unit="m" val="20" />
<attnum name="border margin" unit="m" val="50" />
<attnum name="border step" unit="m" val="30" />
<attnum name="border height" unit="m" val="15" />
<attstr name="orientation" val="clockwise" />
</section>
</section>
<section name="Main Track">
<attnum name="width" unit="m" val="14.0" />
<attnum name="profil steps length" unit="m" val="4.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of track-->
<section name="Left Side">
<attnum name="start width" unit="m" val="4.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="0.5" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of left part-->
<!--Right part of track-->
<section name="Right Side">
<attnum name="start width" unit="m" val="4.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="0.5" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />

</section>
<!--End of right part-->
<section name="Pits">
<attstr name="side" val="right" />
<attstr name="entry" val="" />
<attstr name="start" val="" />
<attstr name="end" val="" />
<attstr name="exit" val="" />
<attnum name="length" unit="m" val="0.0" />
<attnum name="width" unit="m" val="0.0" />
</section>
<section name="Track Segments">
<!--******************************-->
<!-- Segment 1 -->
<!--******************************-->
<section name="recta1">
<attstr name="type" val="str" />
<attnum name="lg" unit="m" val="200.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="7.0" />
<attnum name="end width" unit="m" val="7.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier-turn" />
<attstr name="style" val="curb" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="4.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier-turn" />
<attstr name="style" val="curb" />
</section>
<!--End of right part-->

</section>
<!--******************************-->
<!-- Segment 2 -->
<!--******************************-->
<section name="curve1">
<attstr name="type" val="rgt" />
<attnum name="arc" unit="deg" val="59.99999999999999" />
<attnum name="radius" unit="m" val="40.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="5.0" />
<attnum name="end width" unit="m" val="15.0" />
<attstr name="surface" val="sand3" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="2.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="grass5" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="tire-wall" />
<attstr name="style" val="wall" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="4.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="1.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="curb" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of right part-->
</section>
<!--******************************-->
<!-- Segment 3 -->
<!--******************************-->
<section name="curve2">
<attstr name="type" val="rgt" />
<attnum name="arc" unit="deg" val="59.99999999999999" />
<attnum name="radius" unit="m" val="40.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />

<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="15.0" />
<attnum name="end width" unit="m" val="15.0" />
<attstr name="surface" val="sand3" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="2.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="grass5" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="tire-wall" />
<attstr name="style" val="wall" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="4.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="1.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="curb" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of right part-->
</section>
<!--******************************-->
<!-- Segment 4 -->
<!--******************************-->
<section name="curve3">
<attstr name="type" val="rgt" />
<attnum name="arc" unit="deg" val="59.99999999999999" />
<attnum name="radius" unit="m" val="40.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="15.0" />
<attnum name="end width" unit="m" val="15.0" />
<attstr name="surface" val="sand3" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="2.0" />
<attnum name="height" unit="m" val="0.05" />

<attstr name="surface" val="grass5" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="tire-wall" />
<attstr name="style" val="wall" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="4.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="1.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="curb" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of right part-->
</section>
<!--******************************-->
<!-- Segment 5 -->
<!--******************************-->
<section name="recta2">
<attstr name="type" val="str" />
<attnum name="lg" unit="m" val="100.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="17.0" />
<attnum name="end width" unit="m" val="7.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of left part-->
<!--Right part of segment-->

<section name="Right Side">
<attnum name="start width" unit="m" val="5.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of right part-->
</section>
<!--******************************-->
<!-- Segment 6 -->
<!--******************************-->
<section name="curve4">
<attstr name="type" val="lft" />
<attnum name="arc" unit="deg" val="90.0" />
<attnum name="radius" unit="m" val="50.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="6.0" />
<attnum name="end width" unit="m" val="10.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="1.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="curb" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="4.0" />
<attnum name="end width" unit="m" val="11.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="curb" />

</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="wall" />
<attstr name="style" val="wall" />
</section>
<!--End of right part-->
</section>
<!--******************************-->
<!-- Segment 7 -->
<!--******************************-->
<section name="curve5">
<attstr name="type" val="rgt" />
<attnum name="arc" unit="deg" val="90.0" />
<attnum name="radius" unit="m" val="50.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="11.0" />
<attnum name="end width" unit="m" val="8.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier-turn" />
<attstr name="style" val="curb" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="10.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="1.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="curb" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier" />
<attstr name="style" val="curb" />
</section>
<!--End of right part-->
</section>
<!--******************************-->

<!-- Segment 8 -->
<!--******************************-->
<section name="recta3">
<attstr name="type" val="str" />
<attnum name="lg" unit="m" val="200.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="8.0" />
<attnum name="end width" unit="m" val="8.0" />
<attstr name="surface" val="sand" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="3.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="grass3" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="wall" />
<attstr name="style" val="wall" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="5.0" />
<attnum name="end width" unit="m" val="10.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="wall" />
<attstr name="style" val="wall" />
</section>
<!--End of right part-->
</section>
<!--******************************-->
<!-- Segment 9 -->
<!--******************************-->
<section name="curve6">
<attstr name="type" val="rgt" />
<attnum name="arc" unit="deg" val="180.0" />
<attnum name="radius" unit="m" val="90.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">

<attnum name="start width" unit="m" val="5.0" />
<attnum name="end width" unit="m" val="10.0" />
<attstr name="surface" val="sand" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="3.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="grass3" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="5.0" />
<attstr name="surface" val="barrier-grille" />
<attstr name="style" val="curb" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="10.0" />
<attnum name="end width" unit="m" val="10.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="1.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="curb" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="5.0" />
<attstr name="surface" val="barrier-grille" />
<attstr name="style" val="plan" />
</section>
<!--End of right part-->
</section>
<!--******************************-->
<!-- Segment 10 -->
<!--******************************-->
<section name="straight 2">
<attstr name="type" val="str" />
<attnum name="lg" unit="m" val="200.0" />
<attnum name="z start" unit="m" val="0.0" />
<attnum name="z end" unit="m" val="0.0" />
<attstr name="surface" val="asphalt2-lines" />
<!--Left part of segment-->
<section name="Left Side">
<attnum name="start width" unit="m" val="10.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="sand3" />
</section>
<section name="Left Border">
<attnum name="width" unit="m" val="3.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="grass3" />
<attstr name="style" val="plan" />
</section>
<section name="Left Barrier">

<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier-turn" />
<attstr name="style" val="curb" />
</section>
<!--End of left part-->
<!--Right part of segment-->
<section name="Right Side">
<attnum name="start width" unit="m" val="11.0" />
<attnum name="end width" unit="m" val="4.0" />
<attstr name="surface" val="grass" />
</section>
<section name="Right Border">
<attnum name="width" unit="m" val="0.0" />
<attnum name="height" unit="m" val="0.05" />
<attstr name="surface" val="curb-5cm-r" />
<attstr name="style" val="plan" />
</section>
<section name="Right Barrier">
<attnum name="width" unit="m" val="0.1" />
<attnum name="height" unit="m" val="1.0" />
<attstr name="surface" val="barrier-turn" />
<attstr name="style" val="curb" />
</section>
<!--End of right part-->
</section>
</section>
</section>
</params>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.