FMS Landscape Programming
The Landscape:
The landscape portion of the program consists of three separate pieces:
• The Contour map
• The ground scenery
• The sky
The Contour Map:
The contour map is a 256 grey scale square bitmap.
The lowest elevation is white which is at zero.
The highest elevation is black which is at a height of 64 meters.
Each of level of grey is an increment of 0.25 meters.
The contour map is entered using the statement: 3D_LANDSCAPE Filename
“Filename†is the name of the contour bitmap file and must not contain any spaces.
The Ground map:
The ground map is square. Its size is specified using the command:
SCENE xxx yyy zz
xxx is the distance in meters from the center of the field to any side.
yyy is the size of each square of ground scenery in the map.
zz is the length of the slope of the ground between contours on the contour map. The minimum value is related to the size of the scenery squares. This minimum can vary between different types of computer. Fairly safe values for the minimum are:
50 .Min 5
100 Min 10
200 Min 20
The scenery squares are placed on the contour map using the command:
QUADRANT xx yz filename
xx refers to the grid location on the contour map, 00 is the South West corner square. 01 is the next square East of 00
yz refers to the number of successive sequential squares that use the specified bitmap.
e.g. “QUADRANT 00 13 Grass†would place the Grass bitmap in grid locations 00, 10 and 20
“filename†is the name of the scenery bitmap file for that map square. The size of the scenery bitmap files must be a power of 2, e.g. 256 x 256 or 512 x 512. The practical maximum limit is 2048 x 2048. The minimum size is governed by the minimum resolution required in your scenery. The filename must not contain any spaces.
The Sky:
The sky is specified using the command:
SKY xxx yyyy filename
xxx is the height in meters of the sky bitmap
yyyy is the length in meters of each side of the sky bitmap
“filename†is the name of the sky bitmap.
The sky is a square bitmap picture. Its size is a power of 2 (usually 256 x 256 x 256 colours)
The Plane and Pilot:
Once the scene has been defined, the position of the plane and pilot must be specified using the commands:
AIRCRAFT_POSITION xxx yyy zz
PILOT_POSITION xxx yyy zz
xxx is the distance North (positive) or South (negative) of the center of the field.
yyy is the distance West (positive) or East (negative) of the center of the field.
zz is the distance in meters above the ground level. Typically the plane would be at 0 and the pilot’s level of vision would be at 1.7
On startup, the plane always faces West (270 Degrees)
AIRCRAFT_POSITION xxx yyy zz FIXED disables the numeric view keys. This is useful in panoramic scenes to keep the pilot’s point of view in one place.
Changing Mode:
Once the scene has been established the following two commands are used to change the programming mode to enable three dimensional objects to be placed on the scenery.
DIM3
QUADS
An example program:
SKY 300 5000 Mysky
3D_LANDSCAPE Mycontour
SCENE 500 200 20
QUADRANT 00 15 Rocks
QUADRANT 10 15 Grass
QUADRANT 20 12 Grass
QUADRANT 22 11 Runway
QUADRANT 23 12 Grass
QUADRANT 30 15 Grass
QUADRANT 40 15 Rocks
AIRCRAFT POSITION 0 0 0
PILOT_POSITION 5 0 1.7
DIM3
QUADS
END
This program would produce a 1000 meter square scene with a 5000 meter square sky picture 300 meters above it. The aircraft would be in the middle of the scene with the pilot 5 meters to the North of it. The aircraft always faces West on startup. It would look like the following:
Adding two and three dimensional objects to a scene
LIGHTNING ON (default) turns on natural lighting from high in the East.
LIGHTNING OFF turns off the natural lighting illuminating objects uniformly.
CULL ON Causes two dimensional objects to be visible from one side only. When viewed from the side on which the corner co-ordinates of the object are listed counter clockwise the object will be visible.
CULL OFF: Causes two dimensional objects to be visible from both sides.
POSITION xx yy zz Defines the position of the next object, in meters, relative to the center of the scene. It can contain decimal values for xx, yy and zz.
xxx is the North/South co-ordinate (North is positive, South is negative)
yyy is the West/East co-ordinate (West is positive, East is negative)
zz is the height above the ground level (below ground is negative)
TEXTURE Filename: Defines which bitmap picture will be used to construct the object.
TEXTURE Filename TRANSPARENT Will cause any black pixels in the bitmap to be transparent when plotted on an object. This is useful for placing irregularly shaped objects in the scene without showing the background of the picture.
The “TEXTURE†command is followed by the rectangular co-ordinates of the required portion of the picture and the location where it is to appear in the scene. e.g.:
POSITION 10 6 0
TEXTURE Mypicture TRANSPARENT
0 255 -1 0 0
255 255 1 0 0
255 0 1 0 3.5
0 0 -1 0 3.5
The first two numbers of each five digit coordinate are the horizontal and vertical location of the corner pixel of a quadrilateral in a bitmap picture. These must be positive integers.
The last three numbers are the x (North/South), y (East/West) and z (Height) coordinates of the location of the corresponding corner of the quadrilateral being drawn in the scene. These can be either positive or negative decimal numbers and are in meters.
Three dimensional objects can be made using a combination of two dimensional objects. Triangles can be made by making the first and last coordinates of a quadrilateral equal to the same value.
COLOR
Two dimensional objects can be constructed by using the COLOR statement instead of the TEXTURE statement. This is good for adding single-colour details to 3D objects. This will only work correctly after the command LIGHTNING ON. Because of this, COLOR objects are only visible from one side.
The first statement for the COLOR object must be TEXTURE OFF. (TEXTURE ON must be used after a COLOR object if it is to be followed by a TEXTURE object).
This is followed with:
POSITION xx yy zz
COLOR r g b x y
r: is the red value
g: is the green value
b: is the blue value
These are positive decimal values between 0 and 1
The values for x and y do not appear to do anything. They are probably leftovers from a previous version of FMS but they must be present or an error will occur.
The coordinates for the desired quadrilateral are listed counter clockwise, in the same way as objects using TEXRURE. E.g.:
TEXTURE OFF
POSITION 6 -5 1
COLOR 0.5 0.5 0.5 0 0
0 -3.1 0
0 -3.1 4.3
0 2 4.3
0 2 0
This will create a grey rectangle facing South., 5.1 meters wide, 4.3 meters high and one meter above the ground. It will be located 6 meters North and 5 meters East of the center of the scene. Three dimensional objects can be made using a number of these quadrilaterals.
ALPHA
Objects made using the COLOR command can be made translucent by following with the ALPHA command e.g.
COLOR 0 0 1 0 0
ALPHA 0.5
This will create a translucent blue object. A value of ALPHA closer to 0 will make it more transparent while a value closer to 1 will make it more opaque.
END
All programs must be terminated with an END statement.
____________________________
This is NOT an official FMS Manual. These instructions have been established using trial and error. There may be errors. If you find any, please let me know so that they can be corrected. This manual was documented by KEW with much technical help from TreeHugger.
_______________________________