wiki:XmlModelConfiguration

Version 5 (modified by Torben Dannhauer, 14 years ago) (diff)

--

<< Back to XML configuration overview

XML configuration of visual_object based models

The complete XML Configuration of a visual_Object is:

<!-- Models can be loaded and placed in the scenery.
   - objectname: Name of the object to identify it in the scenegraph.
   - tracking ID: ID to manage which object should be tracked
   - label: text to label the model with.
   - dynamic: "yes" to add an standard updater to the model. 
-->
<model objectname="TestObject" trackingid="1" label="TestText!" dynamic="no">
 <position lat="47.8123" lon="12.94088" alt="700.0"></position>
 <attitude rot_x="0.0" rot_y="0.0" rot_z="0.0"></attitude>
 <updater>
  <position lat="" lon="" alt=""></position>
  <attitude rot_x="" rot_y="" rot_z=""></attitude>
  <label text=""></label>
 </updater>
 <cameraoffset>
  <translation trans_x="0.0" trans_y="0.0" trans_z="0.0"></translation>
  <rotation rot_x="0.0" rot_y="0.0" rot_z="0.0"></rotation>
 </cameraoffset>
 <geometry filename="../models/saenger1.flt">
  <offset rot_x="0.0" rot_y="0.0" rot_z="0.0"></offset>
  <scalefactor scale_x="1.0" scale_y="1.0" scale_z="1.0"></scalefactor>
 </geometry>
</model>

Position & Attitute

To position the visual_object, you have to setup a location in latitude (in degree), logitude (in degree) and altitude. Additionally you have to specify it's attitude in degree.

<position lat="47.8123" lon="12.94088" alt="700.0"></position>
<attitude rot_x="0.0" rot_y="0.0" rot_z="0.0"></attitude>

Updater

To update certain properties of the visual_object, you can define an updater and configure the slot names which should be used for the updates. The attributes in the XML entries are not values but names of the slots which content should be used for updating the visual_object every frame. To skip updating of a certain value, leave the updatername emtpy.

The updater can be defined in the XML configuration file as followed:

<updater>
 <position lat="your_lat_slot" lon="your_lon_slot" alt=""></position>
 <attitude rot_x="your_rot_x_slot" rot_y="" rot_z="your_rot_z_slot"></attitude>
 <label text=""></label>
</updater>

Camera Offset

To use the "Object mounted" camera manipulator, you have to define for your what the camera coordinates relative to your visual_object are. You can define a rotational (in degree) und translational offset.

The defition of the camera offset in the XML configuration file is:

<cameraoffset>
 <translation trans_x="0.0" trans_y="0.0" trans_z="0.0"></translation>
 <rotation rot_x="0.0" rot_y="0.0" rot_z="0.0"></rotation>
</cameraoffset>

Geometry

You can load and display a 3D geometry to visualize the 3D object. You have to specify the filename with an relative or absolute path. If the 3D model has the wrong orientation or wrong size, you can specify an offset rotation (in degree) or scale factors. Using a geometry as well as modifying it with offset or scalefactors is optional.

The XML configuration of an geometry entry in a visual object is:

<geometry filename="../models/saenger1.flt">
 <offset rot_x="0.0" rot_y="0.0" rot_z="0.0"></offset>
 <scalefactor scale_x="1.0" scale_y="1.0" scale_z="1.0"></scalefactor>
</geometry>

If you do not use a geometry, a visual_object is still usefull, e.g. for dynamic positioning and upating a text label or to attach the camera.