Display

Section author: Luke Frisken <l.frisken@gmail.com>

The com.atc.simulator.display package contains all the display functionality for this application.

Diagrams

../../../_images/Class_Design1.svg

Class Design

Overall Design

The display is designed to be a high performance opengl application. It achieves this aim by using libgdx’s models api to create instances of the draw geometry to get stored in the gpu vertex buffers. The main problem of this method is that managing, and updating the resources can be expensive and a bit complicated. Currently view.DisplayRenderableProvider objects are used to store the state of geometric object, to update it, and to render it.

Display Methods

Of primary interest is the view.model_instance_providers.PredictionModel class which contains the code for displaying the predictions. The different types of available display methods are enumerated in model.PredictionDisplayMethod

GRADIENT

The current most advanced display method is the GRADIENT method. This method creates a mesh between the Right, Centre and Left tracks, and UV maps the vertices to a generated gradient texture.

../../../_images/gradient.png

GRADIENT display method

Unfortunately there is a problem with the texture interpolation being incorrect for trapezoid shapes. This will probably require adding an extra dimension to the UV map coordinates in order to do perspective correct texture projection. Unfortunately this also probably means changing the underlying libgdx framework which is not a small task, so this problem has been sidelined.

TWO_LINE

../../../_images/two_line.png

TWO_LINE display method

WIREFRAME

../../../_images/wireframe.png

WIREFRAME display method