Page 1 of 1

Everything you ever wanted to know about .ter files but were afraid to ask

Posted: Fri May 08, 2015 7:04 am
by waspe414
This is a sample .ter:
TerrMesh
SPEC FALSE
NBL 2 3
TMS 170.14 161.48
CBE 0.00 170.23 46 112 10 194 169 92
BLO 0.00 L 1 194 169 92 1 46 112 10
BLO 0.00 R 1 194 169 92 1 46 112 10
BLO 0.00
BLO 0.00 R 1 194 169 92 1 194 169 92
BLO 212.78 R 1 194 169 92 1 194 169 92
BLO 0.00
BLO 0.00 R 1 46 112 10 1 194 169 92
BLO 212.78 L 1 46 112 10 1 194 169 92
BLO 0.00
BLO 0.00
BLO 0.00
BLO 0.00
END
Let's break it down.

TerrMesh defines the filetype (similar to the DYNAMODEL header in .dnm and SURF in .srf)

SPEC FALSE or SPEC TRUE disable or enable specular reflections (currently found only in the OpenGl2 version).

NBL # # defines the number of columns and rows the elevation grid has.
TMS defines the square dimensions, and so is grid length and width divided by NBL.
See below for CBE.

The BLO lines come in blocks. Each block has as many lines as NBL # #, and there are as many blocks as NBL # #. Blocks are ended by BLO 0.00, which defines the last (faceless) node on the line. The last block is made up of only node lines (being the final edge of the grid, there are no faces to associate with the nodes).

BLO 0.00 R 1 0 127 0 0 0 127 0

Part of the grid
Node height(m)
Left or right face orientation (from Elevation Grid > Flip Selected Faces)
Face state: invisible (0), visible (1), projected picture flag (2), or protected face (3)
Face colour


The CBE line defines the gradient.
The gradient is calculated when applied in Scenedit, and colours the individual faces, then smooths them. It won't recolour if elevations are changed, so it's possible to get the peak colour on the side of a mountain if you change the geometry without updating the gradient.

CBE 0.00 170.23 46 112 10 194 169 92
Zero
80% of maximum height when the gradient is calculated. These two don't currently do anything, but may eventually be for changing gradient distribution.
Foot colour
Peak colour

As usual, the file ends with END.

Everything you ever wanted to know about .ter files but were afraid to ask

Posted: Fri May 08, 2015 12:40 pm
by Barr
Nice.....

Thanks for the post waspe.

Everything you ever wanted to know about .ter files but were afraid to ask

Posted: Fri May 08, 2015 1:44 pm
by decaff_42
Just a couple of things to add that I have found.

The TMS line is the true size of each dimension divided by 10.

The BLO 0.00 is actually referring to the last node in the block. There are the input number of faces but #+1 nodes. the BLO 0.00 refers to the last node in the block. This is useful when creating elevation grid buildings.

Everything you ever wanted to know about .ter files but were afraid to ask

Posted: Fri May 08, 2015 5:35 pm
by waspe414
Better correction: TMS is the square length and width, and so is real dimesions / NBL.
BLO 0.00 makes total sense.

Re: Everything you ever wanted to know about .ter files but were afraid to ask

Posted: Tue Apr 02, 2019 2:41 am
by decaff_42
Bumping to add some more information.

If you want to define the side wall colors, for an elevation grid building, then you have more lines at the beginning of elevation grid definition. If all the walls of your elevation grid can be the same color, then this makes things simple. :D

For this elevation grid:
  • BOT is the SOUTH Side
  • RIG is the right or EAST Side
  • TOP is the NORTH Side
  • LEF is the WEST Side

Code: Select all

TerrMesh
NBL 2 4
TMS 256.43 239.05
BOT 0 0 215
RIG 194 169 92
TOP 46 112 10
LEF 46 112 10
BLO 0.00 R 1 46 112 10 1 46 112 10
BLO 0.00 R 1 46 112 10 1 46 112 10
BLO 0.00
BLO 314.14 R 1 46 112 10 1 46 112 10
BLO 314.14 R 1 46 112 10 1 46 112 10
BLO 0.00
BLO 0.00 R 1 46 112 10 1 46 112 10
BLO 314.14 R 1 46 112 10 1 46 112 10
BLO 0.00
BLO 0.00 R 1 46 112 10 1 46 112 10
BLO 78.53 R 1 46 112 10 1 46 112 10
BLO 0.00
BLO 194.13
BLO 0.00
BLO 0.00
END