+ mesh = new GL::Mesh((GL::NORMAL3, GL::TEXCOORD2, GL::VERTEX3));
+ mesh->set_winding(&GL::WindingTest::counterclockwise());
+ GL::MeshBuilder bld(*mesh);
+
+ unsigned index = 0;
+ bld.texcoord(0.17, 0.5);
+ for(vector<TrackPart>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ build_part(*i, ballast_profile, Vector(0, 0, -ballast_min.y), false, bld, index);
+
+ float y = ballast_h-tie_min.y;
+ bld.texcoord(0.83, 0.5);
+ for(vector<TrackPart>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ build_ties(*i, tie_profile, appearance.get_tie_length(), appearance.get_tie_spacing(), Vector(0, 0, y), bld, index);
+
+ bld.texcoord(0.5, 0.5);
+ y = ballast_h+tie_h-rail_min.y;
+ for(vector<TrackPart>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ build_part(*i, rail_profile, Vector(0, gauge/2, y), true, bld, index);
+ for(vector<TrackPart>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ build_part(*i, rail_profile, Vector(0, -gauge/2, y), false, bld, index);
+
+ object = new GL::Object;
+ object->set_mesh(mesh);
+ object->set_technique(&catalogue.get<GL::Technique>(appearance.get_technique()));