原英文资料:
Prerequisites:
Successful completion of LynX Tutorial.
Introduction:
This exercise will demonstrate all the necessary steps to create a simple DIS application to sendand receive Protocol Data Units (PDUs) over your network.
The basic steps are 1) create your objects 2) configure DIS attributes for each object:
The main DIS components are :Inbound Template Entity Information, Outbound Entity Information and Outbound Entity Appearance.
Inbound Template Entity Information is used to define the force and type for the tank which will be used to map a specific tank to this template object. When the object is determined to be the best match, it will be copied and added to the DIS-HLA scene automatically.
Outbound Entity Information dialog contains information regarding the outbound network entity which may be associated with any Vega object.
Outbound Entity Appearance determines the initial state of the outbound entity when it is broadcast.
Munitions mapping, appearance mapping, and articulation mapping features are also supported by DIS, however those subjects are out of the scope of this tutorial.
Please see the example code and the Vega Options Guide for more details regarding these features.
Tutorial:
Step 1: Invoke LynX
NT
Start Æ Program FilesÆVegaÆ LynX
IRIX
Open a winterm
Type ‘lynx’ on the command line.
Step 2:Turn off unnecessary modules
Before you begin creating your DIS application, let's turn off all
add-on modules that will not be used for this exercise.
Under the File pull down menu, choose "Active Modules". Turn everything off "except" the following add-on modules:
Vega 3.X
DIS/HLA
Base3.X
Step 3: Create the battlefield.
From the Icon Column, select the ‘object’ icon
From the object’s pull down menu select ‘New’
When prompted name the object ‘town’
Assign :
NT:
c:\program files\paradigm\Vega\sample\data\Vega\testdb.flt as the geometry file
UNIX:
/usr/local/PSI/demo/testdb.flt as the geometry file
Assign isector bit mask for terrain mapping On the Objects panel, select the button called "Object Isector Class".
After selecting the Override Option, set the Isector class with all "terrain bits" turned "on" ( terrain bits 1-8).
Assign DIS attributes to the town.
Under the Objects pull down menu, select the "Inbound Template Entity Information".
Disable all check boxes, since this object will be used only by you, (no PDU's need to be sent for the "terrain").
Close this dialogue box.
Under the Objects pull down menu select the “Outbound Template Information:
Disable all check boxes, since this object will not send any PDUs either.
Close this dialog box
Save your ADF as DISPlayer1.adf
Step 4: Configure your local entity:
From the object’s pull down menu select “New”
When prompted name the object “my tank”
Assign :
NT:
c:\program files\paradigm\Vega\sample\data\Vega\tank_m1.flt as the geometry file
UNIX:
/usr/local/PSI/demo/tank_m1.flt as the geometry file
Set the Coordinate System to “Dynamic”
Assign DIS attributes for your local entity
High light “my tank” in the entity list.
Under the Objects pull down menu, select the "Inbound Template Entity Information" Option.
Disable all check boxes, since this object will be used only a local entity.
Close this dialogue box.
NOTE: On NT, the Inbound Template Entity Information dialog box is a “tab”.
When you have made you selections, please select the tab labeled “Vega”.
Highlight “my tank”
Under the Objects pull down menu, select the "Outbound Entity Information".
Check the “Enable for Sending” box
Set the Dead Reakoning to Rot/ConstPosRate/WorldCoords.
Under the Entity Type set the following:
Kind: Platform
Domain: Land
All other values leave at the Default, 0.
Close this dialogue box.
NOTE: On NT the Outbound Template Entity Information dialog box is a “tab”.
When you have made you selections, please select the tab labeled “Vega”.
Under the Objects pull down menu, select the "Outbound Entity Appearance".
Marking Text : Assign an intuitive name i.e. ‘player 1’
Close this dialogue box.
NOTE: On NT the Outbound Entity Appearance dialog box is a “tab”.
When you have made you selections, please select the tab labeled “Vega”.
Save Your ADF!
Step 5: Configure your inbound template:
From the object’s pull down menu select “New”
When prompted name the object “inbound tank”
Assign :
NT:
c:\program files\paradigm\Vega\sample\data\Vega\tank_m1.flt as the geometry file
UNIX:
/usr/local/PSI/demo/tank_m1.flt as the geometry file
Set the Coordinate System to “Dynamic”.
Configure your inbound template for DIS
Highlight “inbound tank”
Under the objects pull down menu, select "Inbound Template Entity Information".
Select the box labeled : “Enable for Receiving”
Under the Entity Type set the following:
Kind: Platform
Domain: Land
All other values remain 0.
Close this dialogue box.
(NT Users please see earlier note!)
Under the Objects pull down menu, select "Outbound Entity Information". Disable all checkboxes, since this object will be used for the "Inbound
Template Entity" only. It is considered a "remote entity".
Step 6: Placing your objects in the Scene.
> Go to the Scenes panel.
Click on the left arrow of the Objects List widget. This will list
all instances of this class. Load the "town " and "my tank" into the scene by selecting the "Apply" button for the "terrain" and the "OK" button for the "tank". The "incoming_tank" IS NOT LOADED into the scene by you!
DIS will handle this with an incoming PDU. |