In this article prior knowledge is assumed about how to create a normal scenery object. A manual for this is the article "Tutorial: Gebäude erstellen".
1 Building the 3d Object
The basis for a future spline is a normal 3D object. When placing the spline the Map-Editor will transform it: the spline can be bend, cut or extended by placing multiple.
The 3D model is built from the 0/0 point into the positive y-axis. It can for example look like this:
Note that the Map-Editor can add additional corner points to the spline to ensure a smooth curve. It is not necessary to add separations or extra points to the model.
2 Importing the spline
We can now start the Content-Tool and choose "Objects & Vehicles", next "Create new Object" and then one of the object category on the right. All categories on the right are for splines, whereas all categories on the left are for "normal" objects. The bottom categories each have special properties and these are not covered here. As we just want to import a simple bicycle path, we choose "Surface spline".
As opposed to this category "Standard Spline" is something that "stands upright" and does not belong to and on the surface, like a fence. A "Marking Spline" is for example a traffic line marking. It is not part of the surface but it follows the surface and does match in a thematic sense.
The object category for our bicycle path is "CAT 1". A fence would be better suited in "CAT 3".
Further categories or genres are chosen as appropriate. Here, "Streets and traffic" and therein "Streets and pavement elements" are suitable choices.
The Object & Vehicle Tool now starts as usual. We now import the mesh as seen before. The presentation has changed however:
The tool has already interpreted the 3D Object and now shows a preview as to how the spline will look in the Map-Editor. In principle you can now save and export it as before, for instance with the "Go" button.
3 Editing spline properties
There are however a couple of peculiarities and special settings we like to introduce here:
3.1 Meshes and Materials
In principle the meshes and materials can be edited in the same way as with normal objects. The only exception to this is that choosing a mesh in the 3D window is not possible. The alternative, which is always available anyway, is selecting with the mesh list on the right of the screen.
There are also several mesh settings that have no effect on splines. Examples are visibility constraints, VisibilityVariable, mouse interactions and Vertex-Ambient-Occlusion
3.2 Spline preview
On the bottom left there is a section called "Spline". Here you can find the "Preview spline prop." button. This leads to a dialog window where you can edit the proporties of the preview of the spline. These are the same as the properties when building a spline in the Map-Editor.
As an example we can change the radius and the length of the spline: R = 10 m and L = 15 m:
3.3 Specific spline properties
There are a couple of special properties in the "Object Properties" in "General settings" on the left.
Please note that at the moment, after changing the properties, you need to click the "Preview spline prop." button mentioned before and click OK to confirm.
3.3.1 Length of a unit
During import, the Content-Tool measure the length of the 3D object and stores that value here. In our example this is 5m. From this value LOTUS know how often to repeat the element and at what distance these copies should be places. For testing you can set this value to 6m:
3.3.2 Allowed SplitCount
To illustrate this we changed the texture on our spline:
This parameter can be either -1, 0 or a positive integer. The corresponding effects are:
-1: The original object will be stretch to cover the entire distance needed:
0: The object will not be stretched or compressed, it will simply be cut off at the end of the distance, without taking into account where on the object that is:
1: The object is stretched or compressed in such a way that the end is always exactly between two copies of segments.
2: A cut can be made at either the end of a segment or exactly halfway:
3, 4, 5...: Cuts can be made at 1/3, 2/3 or 1, respectively 1/4,2/4,3/4 or 1, respectively 1/5,2/5,3/5,4/5 or 1, etc.
If we set this setting to 4, in our example cuts can only happen at the border between two colours:
3.4 Special material properties
Spline materials have an additional property "Terrain Cutting Variant". This decides how the meshes of a surface or marker spline using this material interact with the rest of the splines and polygons of the terrain when cut:
- As configured in the MapEditor: Default setting - whether the meshes that use this material cut the terrain is controlled directly by the configuration of the spline in the MapEditor
- Forces the cutting: Meshes using this material always cut the terrain, regardless of the properties of the spline in the MapEditor.
- Never cut: The meshes using this material never cut anything
- Only cut, the mesh remains invisible: The meshes that use this material cut "as usual", but are not displayed
- Also cuts the markings, mesh remains invisible: (Only for surface splines) Same as the previous setting, but in addition the mesh also cuts all splines and polygons on the marker layer! In this way, e.g. grooved tracks can be provided with an additional cutting mesh, which ensures that no road markings or similar can run over the grooved track.
4 Optimization
4.1 Use of a separate cut mesh
Important: If it is a surface spline, it is essential to check whether a much simpler cutting mesh can be created! The cutting algorithm of the MapEditor is on the one hand the faster and on the other hand the more stable the less polygons have to be calculated. Especially vertical polygons or even "overhangs" can be a problem!
The classic example is a curb:
For this, an alternative sectional mesh can be created, which can be processed much easier, faster and safer:
This is created and imported as a separate object. Since it will later become invisible, the mapping and texture do not matter (but it should only be one, otherwise it will be split in the Object & Vehicle tool). Together it looks like this:
A separate material must be assigned to the cutting mesh (if necessary by making a copy).
The materials of the "normal" meshes are reconfigured so that they no longer cut, i.e. the material property "Terrain Cutting Variant" is set to "Do not cut at all". For the material of the cutting mesh, on the other hand, "Terrain Cutting Variant" is set to "Cut only, the mesh remains invisible". To make the mesh invisible in the preview image, you can also set "Min. alpha" to a value greater than one (e.g. two).