Add OpenGL heads-up display


Purpose
This sample shows a combination of Dynamic Display application programming interface (API) drawings and pure OpenGL drawings in the same tool. This sample shows the map's azimuth as a heads-up display (HUD) that updates automatically when the map rotates. In this sample, while you are rotating the map, the numbers referenced in the HUD are different than the numbers reported by the rotation tool. The reason is that the reported map rotation is the mathematical angle, while the HUD shows the angle from the north (the map's azimuth).

How to use

See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Run the sample.
  2. Click the Add OpenGL HUD command. A heads-up-display is added to the map.
  3. Use the Rotate tool to rotate the map. The display is updated to reflect the rotation of the map.


Download the files for Java
display/HUDApplication.java Creates the graphical user interface (GUI) for the sample.
display/ShowHUDCommand.java Represents a command that sets the map to dynamic mode. The command attaches a map event listener, which draws the HUD using Java OpenGL (JOGL) in each AfterDynamicDraw event. It also attaches a display transformation event listener to update the HUD as the map is rotated.




Additional Requirements
  • While running the sample using the Java command, you must provide the Djava.library.path=<path_to_jogl_lib_folder> VM argument. The value of this argument depends on the operating system you're using. For Windows, it will be similar to %ARCGISHOME%/java/samples/engine/lib/jogl/jogl-1.1.0-windows-i586/lib.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime