Visit PANCROMA Website

Go to www.TERRAINMAP.com
Close this Window

BLACKART 3D Graphics Module

BLACKART version 4.00 featured for the first time a 3D graphics rendering module. Subsequent versions added functionality, including the ability to construct stereo pairs. This article we will explore the 3D module and its features.

BLACKART is currently only capable of rendering 3D processed images. This is because the graphics module uses as its input the processArray that is produced after the interpolation algorithms have run. It would be possible to initialize the processArray with the inputArray but this would have required too much modification of existing modules with the possibility of unwanted side effects, so this will be left for future versions.

We will start the tutorial by loading the 90m resolution SRTM file N38W084 by selecting 'File|Open' from the main menu and selecting the 'SRTM height files' option. For this exercise we will work with a subset of the image. Select 'Graphics|Subset|Subset Process Image' from the graphics menu and then select the target subset using the rubber band box. The resulting subset image is shown to the right.

Now input the desired number of iterations by selecting 'File|Input Data'. I chose 100 Laplacian iterations for this example, as a simple interpolation of a narrow band caused by the river at the bottom of the canyon needed fixing. Now run the interpolation by selecting 'Run|Run BLACKART' from the main menu. When the interpolation is finished, the 'View' menu will be enabled. Select 'View|Display 3D Image'. In a moment, a Graphics Image window and a 3D Image Control Panel will be displayed. A rendering of a typical application desktop showing the control panel is shown to the right.

The 3D rendering will be rather small initially. Click on the 'Scale+' button on the Control Panel repeatedly until the image nearly fills the graphics window. You may wish to click the 'Translate -X' button and 'Translate -Y' buttons a few times to position the model properly. Now click the 'Rotate -X' button a few times. The image will tilt back around the X-axis. You will notice that the image does not appear very recognizable because the vertical elevations are exaggerated as a result of the scaling operation. To correct this, enter an 'Elevation Scale Factor' of something like 0.1 and then click the 'Render Image' button. The terrain should look much more acceptable with the proper elevation scaling. The rotated, scaled, elevation corrected 3D image is shown in the second figure to the right.

Now experiment with the lighting. I changed the Solar Bearing Angle to 245 and then selected Render Image again. This changed the position of the "sun" to a westerly position and improved the illumination of the features. It is also possible to change the angle of the "sun" above the horizon by changing the entry in the 'Solar azimuth angle' text box.

You will notice that a three-colored axis system is positioned at one corner of the image. This can be switched on and off using the radio buttons labeled 'Show Axes' and 'Hide Axes'. You must select 'Render Image' after each selection to update the image. My test image is shown in the second figure to the right.

BLACKART also allows you to create stereo pair images. To do this, enter the desired stereo angle in the text box marked 'Stereo Angle' and click on the 'Stereo Image+' button. The image will be rotated counter clockwise by the number of degrees entered into the text box. One degree is a good place to start. Note that the production of workable stereo pairs by this method may take a bit of trial and error in order to get the best image. After the image is rotated, save the image by selecting 'File|Save 3D Image|jpg' from the main menu and naming it something like 'leftstereo'. (Important Note: as a result of the way by which an Open GL graphics window must be opened in Builder and/or my limited understanding of the Windows API, it is currently necessary to ensure that no other windows are overlaying the graphics window. If they do, only a partial image will be saved, that is, only the unobstructed portion of the image. You will also note that the image regenerates only slowly when another window is dragged across the OpenGL graphics window. This is because the OpenGL window cannot take advantage of the Borland automatic buffering capability but must instead be recomputed.) The left stereo image is shown in the third figure to the right.

When the image is saved, produce the right stereo image by selecting 'Stereo Image -' from the Control Panel. Save it as before, except this time naming it something convenient like 'rightstereo'. The click on the 'Restore' button and your image will be returned to its original orientation. The right stereo image is also displayed to the right.

Now you can use a utility like Takashi Sekitani's excellent 3D Anaglyph Maker to convert the two stereo images into an anaglyph. In order to do this, load up the utility and select 'Load Left Image' Your leftstereo.jpg image goes here. Now select Load Right Image'. Your rightstereo.jpg goes here. Select radio button 'Anaglyph Color (Red-Cyan) and then select 'Make 3D Image'. The anaglyph is shown next. Now save your image by selecting 'Save 3D Image' also selecting the '3D Image (Anaglyph, Interleave, 3D-LCD' radio button. You can now inspect your image using a pair of red/blue 3D glasses that you can purchase inexpensively from a variety of sources.

Hopefully this tutorial will give you some ideas for using the BLACKART 3D capabilities to inspect your interpolated images within the program environment, as opposed to exiting and using another tool. I hope to add more features in the future.

[ Click to enlarge.]

SRTM file N38W084 Subset Image - 2D.



[ Click to enlarge.]

Typical Application Desktop.
[ Click to enlarge.]

SRTM file N38W084 Subset Image - 3D.
[ Click to enlarge.]

SRTM file N38W084 Left Stereo Image.
[ Click to enlarge.]

SRTM file N38W084 Right Stereo Image.
[ Click to enlarge.]

SRTM file N38W084 Anaglyph Image.