CCG/Modelling: FixedTrack

From TrainzOnline
< CCG
Jump to: navigation, search

Contents

FixedTrack

FixedTrack - Curves abd Crossings

CCG Arrow on Fixed track.jpg

A fixedtrack in Trainz could be likened to a model train sectional track system. They snap into position when moved onto another track in Surveyor.

Technically, all a fixedtrack comprises is a mesh asset with an attached track (or tracks) and surveyor-only rendered arrows so the user knows where the fixedtrack segment starts and ends.

The model consists of a few attachment points (using the a.name naming convention) set-up accurately in 3dsmax or gmax, and a single invisible polygon to allow exporting, and for in-game asset selection.


Note that correct track end attachment orientation is essential. The Y axis must point `out' at the correct angle. The Z axis must point `up'. Mid points only need to be in the correct spline path.

Crossing Attachments Curve Attachments

CCG fixed track attachments.jpg


When a spline track is attached to a fixedtrack the fixedtrack will update to the attached track type. (unless the tag useadjoiningtracktype 0 is used - see example config.txt file).


The arrows are inserted at each end as a kind attachment - referenced by the arrow's KUID: <KUID:-3:10092>


Each fixedtrack asset needs a preview-mesh, as spline tracks will not render in the Preview window. A preview-mesh can simply be setup as a kind mesh. This way the preview-mesh will never be selectable or seen in Surveyor.


Early Trainz versions released fixedtracks consists of only curved and straight sections. Crossings may be made, just create two attached-track fields. For junctions, see below.


FixedTrack - Junctions

Junctions (turnouts) are possible in Trainz, with the use of additional tags. A number of samples are available in TC. Because the Kind fixed track is not based on the Kind Track asset, there is some functionality for the common flexi track that is not available for the fixed track asset.

The default red and green direction arrows of the flexi track junctions are not available with the fixed track object.
The fixed track object may be raised or lowered and placed on a slope.
Operation of the turnout using the mouse will only operate one trigger or animation.


Multiple operations such as double slip junctions should be possible by scripting.


The in-built example asset from TRS2006 has been constructed with a main default mesh consisting of the fixed rails and ballast, the moveable blades are a separate animated mesh connected to an attachment point in the main mesh, and a separate lever mesh also connect to an appropriate attachment point either to the left or right of the default mesh.


In the in-built example, the red and green arrows have been simulated using an arrow texture with some transparency, with rotating animation, and attached to the lever attachment points. By amending the config.txt file, the arrows and the levers may be deleted or replaced by other suitable meshes.

CCG junction.jpg

CCG fixedtrack junction atts.jpg

a.track0b is the common track attachment point. The curved track may require more attachment points than the straight track, to define the curve shape.

Note the Y axis at the end attachments must point outwards and be aligned with the track entrance or exit direction.

To define the attached track in attached-track container, attachments a.track0a and a.track0b are common to both track tag lists.


The vertices are listed as:

for the curved track0
        0 a.track0a
        1 a.track0b
        2. a.track0c
        3 a.track0d
        4 a.track0e
  
and for the straight track1
        0 a.track0b
        1 a.track1a
        2 a.track1b

CCG junction diag1.jpg

The diagram shows the positioning of:

· the various track attachments (referenced in the attached-track container);
· the helper point b.r.blade for the animated blades; and
· the switch lever attachment, a.lever0, called the junction-vertex tag in CCP, and the lever mesh, referenced by the junction-lever-mesh tag in CCP.


For convenience, the b.r.blade is placed on the origin, and is also the helper for the default mesh (the fixed parts of the turnout).


For examples of the attributes and tags required for Fixed Track assets, refer to Kind Fixed Track Containers, Tags and Examples in Chapter 6 and Chapter7.


Note that in this example, actual meshes for the ballast and shape of the junction track have been created in 3dsmax/gmax. This mesh will show in the Surveyor preview window, and a separate referenced preview mesh is not required.


Use a preview mesh where track is called up between attachment points and no actual mesh is used, the asset mesh is too large to be a true representation in the preview window (airport model), or the mesh used does not show a recognisable preview.


Previous Page . . . . Next Page

Return to CCG Index

Content Creator's Guide

Personal tools