140 likes | 306 Views
VPF Data Viewer. Using OpenGL. About VPF. Vector Product Format - MIL-STD-2407 Issued 28 June 1996 Consists of a combination of Vector data (for drawing) and Attribute data (for indexing) Widely supported, but rarely fully used. Very complicated to understand
E N D
VPF Data Viewer Using OpenGL
About VPF • Vector Product Format - MIL-STD-2407 • Issued 28 June 1996 • Consists of a combination of Vector data (for drawing) and Attribute data (for indexing) • Widely supported, but rarely fully used. • Very complicated to understand • Base document is 128 pages, not including appendices • Inefficient storage mechanism
Technical Overview • Straightforward Approach • Load data from VPF files • Calculate XY points from data • Draw lines on the screen • Standard OpenGL commands • Using GL_LINE_STRIP for lines • Using Orthographic Projection
Challenges There were problems faced during this project that are common to most graphics based applications. • Too much data • Converting Latitude/Longitude points to X/Y screen locations.
First Problem – Too much data For example, the sample database downloaded from NIMA contained 544 MB of raw data. The process of removing extraneous objects from being drawn is known as culling. There are many methods of culling commonly used in 3D graphics, including: View-Frustum Culling Bounding-Volume Culling Bounding-Volume Hierarchies Backface Culling Cells and Portals Levels of Detail
VPF Topology Levels • Method of changing the level of detail in the VPF data. • Included in the VPF specification. • Effectively, the VPF database gives more information (lines and faces) when supplied with a higher VPF topology level. • VPF specification supports 4 levels.
VPF Tiles • VPF specification uses tiles as an index to the data in a database • The tile definition consists of a minimum and maximum latitude and longitude • The process is common across mapping applications • Method of View-Frustum Culling in a 2 dimensional environment
Second Problem – Converting Lat/Lon points to X/Y points. • Mapping projection converts Lat/Lon to X/Y. • Takes points on a sphere (Earth) and projects them onto a flat surface (map). • In use since Mercator presented the first projection in 1569AD. • Project uses an open-source library for projections. • OpenGL Viewport performs final conversion to screen coordinates.
Island in Lake on Island • How to store the data so that only land area can be drawn? • In drafting, this becomes the window in the wall problem. • VPF solves this with ring tables. Faces are made up of rings, starting with the outer-most ring and containing any number of inner rings.