Graphics Reference
In-Depth Information
not smooth in the seam. The effect was shown as in Figure 3. It was designed to solve
this problem that merging the normal of the same vertex of on the adjacent side in
adjacent block, before the boundary vertices normals were normalized. Then
normalize normals. The effect after terrain splicing was as shown in Figure 4.
4
Shading Terrain Blocks
The application of the hill shading uses color shading. The value of the vertex color
needs a frame of reference. Common method is to establish height-color mapping
table. To establish the mapping table with reference to the traditional color habits on
one hand: blue for ocean, green-brown for land, white for high mountains; on the
other hand in accordance with “the higher the brighter”. The height interval was
designed between -11100m and 8900m. Because the interval is so long, the red color
and grey color were added.
The value of these DEM data on the parts of ocean was filled with an invalid value
-9999 or 0. Although some parts of the data is invalid, but consider the possible future
expansion of the system, still the zone of blue reserved to represent ocean. After
setting up the mapping color on key height, the color mapping of different height can
be calculated using linear interpolation by using the table as reference.
As the RGB color model of the computer is not intuitive, the HSV color model was
selected to represent colors. The conversion algorithm of HSV value to RGB value
can be found in reference [6]. As shown in the Figure 5, the direction of the arrow
represents the height of the system from low to high, the corresponding color tint
gradient sequence.
Fig. 5. HSV color model Fig. 6. Interface of Lighting parameters setting
XNA supports flexible programmable pipeline. The system uses an instance of the
BasicEffect class in XNA to achieve basic lighting effects on terrain model.
There are four main factors to control lighting effect in XNA. They are azimuths of
the sun, altitude of the sun, color of ambient light, color of diffuse light. As the hill
shading effects is produced due to illusion and psychological association [1]. Because
of the existence of the pseudoscopic effect [7], the four parameters are opened to the
user. Figure 6 shows the interface of setting these parameters.
Search WWH ::




Custom Search