trngraph - Print Trn/Trx files to graphs
trngraph [--help|-h] [--version|-V] [--verbose|-v]
[--config config-file]
[--output|-o output-filename]
[--width|-W output-width-in-pixels]
[--height|-H output-height-in-pixels]
[--scale|-s scale]
[--walkmesh|-w color]
[--walkable|-a color]
[--water|-A color]
[--megatilegrid|-g color]
[--grid|-G color]
[--gridscale|-S scale-of-grid-in-meters]
[--heightmap|-m heightmap-specification]
[--light|-l directional-light-direction]
[--terrain|-t]
[--colors|-C]
[--crop|-c]
filename ...
trngraph --help
trngraph reads trn/trx and prints out picture having varios things
from the original trx/trn. What is printed out depends on the
arguments given.
- --help -h
-
Prints out the usage information.
- --version -V
-
Prints out the version information.
- --verbose -v
-
Enables the verbose prints. This option can be given multiple times,
and each time it enables more verbose prints.
- --config config-file
-
All options given by the command line can also be given in the
configuration file. This option is used to read another configuration
file in addition to the default configuration file.
- --output -o output-filename
-
Output filename. The output file format is taken from the extension of
the filename. If it is not understood then png is used.
- --width -W output-width-in-pixels
-
Width of the output picture in pixels. If not given then scale
pixels = 1 meter is used. This will overwrite the scale and height
parameters.
- --height -H output-height-in-pixels
-
Height of the output picture in pixels. If not given then scale
pixels = 1 meter is used. This will overwrite the scale if given.
- --scale -s scale
-
Scale the picture, multiplying the coordinates by given scale. This
will automatically scale also the output picture if no height or
width are given.
- --walkmesh -w color
-
Print walkmesh on the picture. Walkmesh triangle outlines are printed
in color given as argument (defaults to green).
- --walkable -a color
-
Print walkable triangles on the picture. Walkable area is printed as
filled triangles of given color (defaults to yellow).
- --water -A color
-
Print water triangles on the picture. Water is printed as filled
triangles of given color (defaults to water color from file).
- --megatilegrid -g color
-
Prints grid in given color in megatile boundaries. The color defaults
to red.
- --grid -G color
-
Prints grid in given color every --gridscale meters. The color
defaults to black.
- --gridscale -G scale-of-grid-in-meters
-
Prints grid in given color every --gridscale meters.
- --heightmap -m heightmap-specification
-
Prints the heightmap to the picture. How the heightmap is printed
depends on the heightmap-specification. The specification has form of
<channel><max>+<offset> or <channel><max>-<offset>, where the
<channel> is either 'red', 'green', 'blue', 'alpha' or 'grey' (or
'gray') and the <max> is the max height on the map (it is mapped to
the max value on the channel) and + or - <offset> is the value that is
added to the height before converting it to color. I.e. the <offset>
in meters is first added to the height in meters and then it is
divided by the <max> value. This results value between 0..1 and that
is then added to the given channel.
- --light -l directional-light-direction
-
This will enable simple flat shading of the polygons using directional
light from the given direction. Direction is given as 3 numbers
telling x, y, and z followed by the base ambient light intensity
(defaults to 0.3 if not given) and then the directional light
intensity (defaults to 0.7 if not given).
- --terrain -t
-
Add terrain texture color to the map.
- --colors -C
-
Add terrain color to the map.
- --crop -c
-
Crop the usable area from the area, i.e. remove unwalkable borders.
Colors, can be given in few different format. They can be in
hexadesimal format using #rrggbb or #rrggbbaa syntax. They can be
desimal format using format red,green,blue,alpha or red,green,blue,
where numbers are either floating point numbers in which case they are
between 0 and 1, or they are integers between 0 and 255.
The separator between numbers can also be / or - or simply whitespace.
Alpha is given as number between 0 and 1 (floating point format) or
between 0 and 255. Value 0 means opaque, and 1 or 255 means
transparent.
If color is empty or just having word default, then default color is
used.
trngraph -o output.png area1.trx
trngraph -H 500 -w default -a default -o pic.png interior_area.trx
trngraph -w default -a default -A default -g default -G default
-S 10 -t -c -C -s 5 -o output.png area1.trx
trngraph -m 'alpha50+5' -w default -a default -A default -g default
-G default -S 10 -t -c -C -s 5 -o ~/nwn2/junk/pic.png a_tk_dyoa.trx
- ~/.trngraphrc
-
Default configuration file.
trnprint(1), Trn(3), and TrnRead(3).
Tero Kivinen <kivinen@iki.fi>.
Program requested by drakolight and nosfe to generate pictures out
from the areas.