skip to main content
Defense > Programmer's documentation > Programming with JViews Maps for Defense > Using the GUI beans > The 3D View bean
 
The 3D View bean
Describes the 3D bean and how to use it.
*Overview
*Describes the 3D bean.
*Integrating the 3D View bean into an application
*Explains how to integrate the 3D View bean into your application.
*Displaying a part of the map in a 3D View
*Explains how to specify which part of the map you want to display in 3D.
Overview
The 3D bean is represented by the Ilv3DView class and displays a 3D representation of a map. This bean is used by the 3D View interactor. The 3D View interactor is a graphic object displayed in one of the layers of a view and represented by the IlvMake3DViewInteractor class, see 3D View interactor.
To create the 3D View, you can either use the 3D View interactor, see Creating and installing the 3D View interactor, or, for more precise control, write the lines of code given in this section.
The following figure shows an example of a 3D View.
The 3D View bean
The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir> /jviews-maps-defense/samples/3dview/index.html.
Integrating the 3D View bean into an application
To integrate the 3D View bean into your application, create the 3D View object in your program:
*Create an Ilv3DModel from an IlvManager (your map container):
 
Ilv3DModel model3D = new Ilv3DModel(manager);
Ilv3DView view3D = new Ilv3DView(model3D);
Since the Ilv3DView extends javax.swing.JPanel, you can integrate it into any Swing container of your application. For example, in a javax.swing.JFrame :
 
JFrame frame = new JFrame();
frame.setContentPane(view3D);
Displaying a part of the map in a 3D View
To specify which part of the map you want to display in 3D:
1. Specify the region to be displayed in longitude and latitude and in radians.
 
model3D.buildTerrain(Math.toRadians(10), Math.toRadians(45),
   Math.toRadians(11), Math.toRadians(46));
2. Make the frame visible:
 
frame.setVisible(true);
Note that you need to choose a region that contains actual elevation data to get a 3D terrain representation (elevation data is provided by raster DEM formats such as DTED format or GTOPO30).
For more information about how to display a 3D View of a map and add symbols to it, see Building and displaying a 3D View of a map.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.