Track Format
Track files are Rail3D model files with .STT extension.
Track files use the "Track2" format (also used for linear scenery) and use a skin texture.
Example Track File
Name STDGGE
TRACK2 |
|
Required |
|
Specifies the name of the track type (this is the name that shows in Rail3D) and that the file uses the TRACK2 format.
TRACK2 is required in track files
|
Skin "$Track_wood.bmp" |
|
Required |
|
Specifies the texture skin used by the model |
|
|
|
|
|
<SWITCH>
SwitchLength 300
SwitchGap 6
SwitchBar STDTieBar
SwitchToe STDFixedToe
SwitchWingL STDWingRailL
SwitchWingR STDWingRailR
</SWITCH> |
|
Optional |
|
Switch Block
The switch block can be used to specify how the track forms a switch/point
- SwitchLength is the length of the switch blades
- SwitchGap is the gap between the blade and the stock rail when the blade is open
- SwitchBar specifies a scenery item for the bar linking the switch blades
- SwitchToe is the scenery item used for the switch two (or frog)
- SwitchWingL and SwitchWingR are the scenery items used for the switch wings
see diagram below
|
<TRACK>
3D STDGGE.3D
</TRACK> |
|
Optional |
|
Track Block
can be used to specify an alternative 3D track model (see below)
|
|
|
|
|
|
#Rail
RAIL 27/0/0 24/0/0 @0.75,0.7
RAIL 27/0/-6 27/0/0 @0.625,0.7
RAIL 24/33/0 24/33/-6 @0.7,0.625
RAIL -24/0/0 -27/0/0 @0.75,0.7
RAIL -27/33/0 -27/33/-6 @0.7,0.625
RAIL -24/33/-6 -24/33/0 @0.625,0.7 |
|
|
|
The RAIL terms specify the rails of the track.
RAIL components are the same as FILL components except that they are handled differently at points/switches.
|
|
|
|
|
|
# Ballast
Fill 55/0/-9 45/0/-9 @0,0.125
Fill 75/0/-12 55/0/-9 @0.24,0
Fill 45/-3/-9 -45/-4/-9 @0.25,0
Fill -45/0/-9 -55/0/-9 @0,0.125
Fill -55/0/-9 -75/0/-12 @0.24,0 |
|
|
|
FILL/RAIL components specify the elements that make up the track shape.
In TRACK2 format each FILL/RAIL element takes two parameters in W/L/H format (the L term is ignored) and two texture terms
H=0 is the top of the rail.
|
|
|
|
|
|
# Sleepers
SLEEPER 45/-3/-6 -45/-3/-6 @0.25,0.495 |
|
|
|
|
|
|
|
|
|
FILL 45/-3/-9 45/-3/-6 @0.623,0.57
FILL -45/-3/-6 -45/-3/-9 @0.623,0.57 |
|
|
|
|
How Rail3D builds the track
Rail3D uses the shape defined in the track file as the cross-section of the track, and extrudes this along the line of the track.
Consider a simple track definition:
FILL -100/0/0 100/0/0 @0,0.25
FILL 0/0/0 0/0/10 @0.5,1
FILL 0/0/10 0/0/0 @0.5,1
This defines three line segments:
The lines are A to B, C to D and D to C (both sides of the vertical)
Rail3D extrudes this shape along the line of the track:
How the texture is applied to the track
Rail3D colours the track by applying a texture along the track, the texture is repeated as many times as necessary to fit the length of the track segment. The texture is repeated in the y direction, so the $Track_wood.bmp texture is:
which when repeated is
The texture is repeated approximatly once per metre of track length (the texture is always repeated an integer number of times, so items like sleepers are reasonably spaced)
The Texture terms specify the x positions on the texture that is applied to the element, so @0,0.25 would select the first 25% of the texture from the left (the ballast).
The texture terms of 0.68 and 0.75 used on the other elements in the example select part the rail part of the texture:
Switch Parts
3D Track
Optionally a 3D track model may be used (the picture above is of a 3D track model). A 3D track model uses the same method as above to define the rails, and the "flat bits" like the ballast surface. However the "3D bits" like sleepers and chairs are modelled as 3D objects and inserted into the model as required by the program.
A 3D track model looks like this:
Name STDGGE.3D
TRACK2 |
|
Required |
|
Name of the model and TRACK2 as before |
|
|
|
|
|
|
|
TRACK3D |
|
Required |
|
Specifies that this is to be used as a 3D track model |
|
|
|
|
|
|
|
Skin "$TrackNew.bmp" |
|
Required |
|
Skin - as before |
|
|
|
|
|
|
|
<SWITCH>
SwitchLength 300
SwitchGap 6
SwitchBar STDTieBar
SwitchToe STDFixedToe
SwitchWingL STDWingRailL
SwitchWingR STDWingRailR
</SWITCH> |
|
|
|
Switch data, as before |
|
|
|
|
|
|
|
<TRACK>
Sleeper STDWoodSleeper
Spacing 20
</TRACK> |
|
|
|
Specifies the scenery item to be used for sleepers
and the spacing
|
|
|
|
|
|
|
|
rails and fills follow as before |
|
|
|
|
|
3D preference switching
3D track takes more processor power to generate and render, so some users may choose not to use the 3D track model. There is a preference setting in Rail3D to enable 3D track or not.
For this user preference to be honoured, track models should be prepared in two versions - the 3D version and the 2D version as shown in the examples on this page.
- The 2D model
- name = the track type (eg STDGGE)
- Track block has the 3D term, which specifies the name of the 3D model.
- The 3D model
- name = track type + ".3D" suffix, (eg STDGGE.3D)
- Track block specifies the sleeper model and spacing
- Has the TRACK3D keyword
When set up like this:
- only the one model (STDGGE) appears in the track library
- If a user has enabled 3D track, Rail3D uses the 3D model (STDGGE.3D) automatically when STDGGE is selected
- If user has disabled 3D track, Rail3D uses the 2D model (STDGGE)
Track designers are encouraged to use this convention so that the user's preference is respected in the program.
Track
MRG 06/02/2015 12:41:29