The best way to show how to build a BGL design object is to actually build one using the BGL design language. The topic Object Structure shows an example of a simple point design created using the SCALE and COLOR commands. The examples in this topic show the development of an object and every component that goes into it. The object created is a blue, 10x10-meter wire frame square on the ground at the south end of the runway at Meigs field in Chicago
First, you can set up the square as shown in the following example.
SPNT-5,0,-5
CPNT5,0,-5
CPNT 5,0,5
CPNT -5,05
CPNT-5,0,-5
The topic BGL Opcode Usage Guide defines the syntax of the graphics commands. In the following example shows the start point definition of an object, SPNT
indicates a start point.
OPERATION: Start surface or line definition. This command should only be used for line drawing and not surface definition.|FORMAT: word opcode
word x-coord byte swapped
word y-coord byte swapped
word z-coord byte swapped
SPNTmacroxx,yy,zz
dw06h
dwxx
dwyy
dwzz
endm
In the preceding example, the arguments -5, 0 , -5 represent the southwest corner point of the square; this is the start point of a line that continues to point CPNT
. A total of four CPNT commands are used to draw the four lines of the square. Notice that the final "continue" point is at the same X,Y,Z coordinate as the start point. The values of -5 and 5 in the example create a square that is 10 units on each edge. The result is a 10 x 10-unit square at a Y altitude of 0 units.
The following example uses the Scale command to give the square a real-world size and location
opcoderange infoscale factorlatitudelongitudealtitude
coarse,finecoarse,finecoarse,fine
SCALEobject_end,0,0,S_16,0046f7abh,0,0c1b17809h,0,180,0
SPNT-5,0,-5
CPNT5,0,-5
CPNT5,0,5
CPNT-5,05
CPNT-5,0,-5
object_endlabelword
In the preceding example, the scale command is separated from the other commands to illustrate its components. Although we only want to show scale factor and world position for the object, all appropriate arguments for the SCALE command must be used. The Scale macro is used to expand the command into bytes and words:
object_end
immediately following our square.Note: We could specify the signal (how far away this object is visible, in meters) and size radius in design units to help with trivial rejection and make the object more projection-efficient. But, in this example, the simpler option is to set signal and size to zero so they will be ignored.
S_16
which equates to 65536 in the macro include file bglmac.asm. This corresponds to a size of 1-meter/design unit. As a result, the 10x10-unit square becomes 10x10-meters square.