terrain features to construct macroscopic terrain. Gen- erally speaking, microscopic terrain features include hill, mountain, plain, tableland and plateau. They are.
TERRAIN SYNTHESIS: AN INTERACTIVE APPROACH Min-Yu Chiang, Shih-Chun Tu, Jun-Yan Huang, Wen-Kai Tai, Cheng-Duo Liu* and Chin-Chen Chang+ Department of Computer Science and Information Engineering National Dong Hwa University *Department of Information Management Shih Chien University + Department of Computer Science and Information Engineering National United University ABSTRACT In this paper, we propose an interactive approach to synthesize macroscopic terrain using real terrain elevation data effectively and realistically. Users construct terrain primitives in the interactive environment by specifying terrain microscopic features. The features are then used to obtain a real terrain unit, one of the best matched terrain units, from terrain unit database where all units are segmented from terrain elevation maps of real world. Each matched terrain unit is then oriented and/or translated to substitute its corresponding terrain primitive for synthesizing macroscopic terrain. As experimental results show, the resultant synthesized terrain is realistic and reasonable, and fits to users’ intuition. 1. INTRODUCTION Terrain synthesis is essential to the construction of realistic outdoor virtual environments. Many applications such as pilot training, scenery browser, game, etc. need terrain models. Upon terrain synthesis, fractal terrain model and simulation approach were two main techniques in the past few years. Fractal terrains lack the natural appearance because fractal terrain in general has no global erosion features inherently. Simulated terrains are time consumed because the complex physical model is computation-intensive. In this paper, our idea is to use several microscopic terrain features to construct macroscopic terrain. Generally speaking, microscopic terrain features include hill, mountain, plain, tableland and plateau. They are classified by elevation, relative altitude and gradient. We use several terrain units to construct the feature microscopic terrain. The macroscopic terrain represents a scene, being constructed by one or various microscopic feature terrains. In our work, an environment is setup for users to specify terrain primitives using terrain features interactively. The terrain primitive represents terrain profile in user’s mind. According to the given features, the real terrain unit, one of the best matched terrain units, is obtained by searching the real terrain unit database where all units are segmented from real terrain elevation map. Then, the terrain unit aligns to its corresponding terrain
sponding terrain primitive and replaces it to synthesize terrain. The proposed interactive environment provides an effective way such that user can intuitively specify features to construct terrain primitives. These constructed terrain primitives convey the overall macroscopic terrain in user’s mind consistently. The resultant synthesized terrain is realistic and reasonable because all source elements, terrain units, of terrain are from real world. Moreover, due to the fact that only modeling is necessary, our approach is efficient without expenses of computation on erosion and simulation in fractal and simulation approaches respectively. The rest of the paper is organized as follows. After briefly reviewing related works, we describe our approach in section 3. Section 4 demonstrates the experimental results about our terrain synthesis method, and finally we give some conclusions and future works in section 5. 2. RELATED WORKS In the past few years fractal terrain model, [1, 2, 3, 4, 5, 7, 8, 9, 12, 14], and simulation approach were two main approaches in terrain synthesis. Musgrave [9] generates fractal terrains in two distinct procedures: modeling and rendering. Modeling is completed by terrain generation and erosion simulation. In terrain generation phase, Musgrave uses summing band-limited noises which refer to as noise synthesis to generate fractal terrain. In erosion simulation phase, Musgrave subdivides the erosive processes into two categories: hydraulic erosion and thermal weathering. Finally, Musgrave renders the results that are contrasted by noise synthesis and erosion simulation using grid tracing. Musgrave uses noise synthesis which locally controls the results by fractal dimension and crossover scale to produce fractal terrains, and proposes grid tracing to improve the rendering on visual effect and time. Simulation approaches, [10, 11], are based on physical erosion theory. Nagashima [10] proposes a simulation approach based on alluvial deposition laws, hydraulic and thermal watering erosion. The result of this approach shows an amazing result, but the time consuming is a serious drawback.
There are other methods which don’t use fractal terrains or physical simulation to generate terrains. Marshall [6] proposes a procedural model to generate scenes automatically. The procedural model uses fundamental
r
Figure 1: (a) Users specify the parameters P1, P2, L1 , L1l, L2r and L2l to obtain the geometrical primitives, two triangles. (b) According to the features of geometrical primitive, we construct the terrain primitive by translational sweeping and scaling the triangle.
length of right side extension to P1 and P2 respectively, l l and L1 and L2 are the length of left side extension to P1 and P2 respectively. In Figure 1(b), the translation sweeping and scaling transformations apply to obtain a solid volume which represents the corresponding terrain primitive.
Figure 2: The mountain range. (a) can be represented by prism-like and/or pentahedron-like terrain primitive. The cone-like terrain primitive can be used to illustrate the mountain (b).
data parameters to create object, and the data parameters are always trivial for user. So this method is useful even though its results are decided by the complete of procedural model. 3. APPROACH In this section, we specify our framework for synthesizing macroscopic terrain. First, we describe how and what controlling parameters can be intuitively used to depict the terrain primitive. Second, the rules for segmenting terrain units from terrain elevation map of real world are specified in subsection 3.2. In subsection 3.3, we detail the matching procedure for searching the best matched terrain unit to substitute for the user specified terrain primitive. Finally, we state the terrain unit alignment and stitching issue. 3.1. Terrain Primitive The terrain primitive is a concept representation object of the microscopic terrain, being used to demonstrate the desired land form (terrain profile) by users. In general, we need more than one terrain primitive to describe one microscopic terrain. So, the terrain primitive should be described as simple and intuitive as possible. Geometrical primitives such as triangle or trapezoid are suitable to be the fundamental element of terrain primitive. User illustrates these geometrical primitives by controlling parameters provided in our interactive environment. Then, a translation sweeping and scaling transformations apply to construct an object, terrain primitive, for the specified geometrical primitives. As r l r shown in Figure 1(a), parameters: P1, P2, L1 , L1 , L2 l and L2 are used to illustrate two geometrical primitives, i.e., two triangles, where P1 and P2 are the peak posir r tion of two triangles respectively, L1 and L2 are the
Figure 3: Sample terrain units. Top row: external primitives. Bottom row: internal primitives. Generally more than one terrain primitive are necessary to completely represent a microscopic terrain. These different features of terrain primitives are characterized by controlling parameters of endpoints while illustrating the geometrical primitive. For instance, if one geometrical primitive that user specified has zero values of elevation and side lengths, then this is an external terrain primitive. Namely, it might be at the boundary of a mountain range. Otherwise, if there are no zero values of all parameters, the terrain primitive is an internal one. Three types of terrain primitives are fundamental to represent all possible forms of mountain. The external terrain primitive is a prism-like object and the internal terrain primitive is a pentahedron-like object. These two types of terrain primitives are usually used to construct the mountain range as shown in Figure 2(a). Figure 2(b) shows another type of mountain which we use the terrain primitive, cone-like object, to represent it. 3.2. Terrain Unit The terrain unit collection contains as wide range of all types of microscopic terrain features, like hill, mountain,
plain, tableland and plateau, as possible such that the matched terrain unit to user specified terrain primitive is as close as possible. All terrain units are manually segmented from terrain elevation map of real world according to rules as follows: 1. The height variation of each scanline in the terrain unit displays higher elevation near the center and lower elevation around the boundary. 2. Each terrain unit contains only one main mountain ridge. If there is more than one mountain ridge in a terrain unit, then it is hard to specify whenever user illustrates the terrain primitive. Sample terrain units are shown in Figure 3. All segmented terrain units are oriented to align each other and normalized in height and right side’s and left side’s length.
8
TU i _ δ 8 DOP = ∑ tp _ pi
8 DOP
− tu _ pi
8 DOP
,
i =1
where tp_pi8DOP and tu_pi8DOP are vertices of k-DOP of terrain primitive and terrain unit. Given a threshold ε8DOP, the candidate set of terrain unit with most terrain contour similarity is Φ8DOP = {TUi | TUi_δ8DOP ≤ ε8DOP, TUi ∈ Φep}. Note that the lower case symbols are normalized controlling parameters. The matching algorithm is summarized as the pseudo code shown as follow:
3.3. Matching Algorithm The main objective of matching algorithm is to find out a candidate set of terrain units that are very similar to the user specified terrain primitive. The similarity is measured using rules of terrain cross-section similarity, mountain ridge similarity, and terrain contour similarity. The endpoints, derived from L1l and L2l, of controlling parameters of specified geometrical primitives are used to determine the terrain cross-section similarity. Namely, this endpoint information of terrain primitive is the vertices of geometrical primitives. The endpoint information of terrain units is derived and normalized from both aligned cross-sections segmented from real terrain elevation map. The candidate set of terrain units with most cross-section similarity is Φtp_p1∩tp_p2 = { tu | |tu_l1l - tp_l1l | ≤ δ1 and |tu_l2l - tp_l2l | ≤ δ2, for all tu ∈ Φtu}, where Φtu is the set of all terrain units, tu_l1l and tp_l1l indicates l1l of tu (terrain unit) and tp (terrain primitive) respectively, tu_l2l and tp_l2l indicates l2l of tu and tp respectively, and δ1 and δ2 are tolerance parameters to tu_l1l and tu_l2l. To measure the mountain ridge similarity, we directly compare the peak positions of terrain primitive with that of terrain units in Φtp_p1∩tp_p2, and we have the candidate set of terrain units with most mountain ridge similarity as Φep = { TUi | |tui_p1– tp_p1| + |tui_p2– tp_p2| ≤ εep, TUi ∈ Φtp_p1∩tp_p2}, where tui_p1 and tui_p2 are peak positions of terrain unit and tp_p1 and tp_p2 are that of terrain primitive. The terrain contour similarity is measured using kDOP (k Discrete Oriented Polytope)[13] for the terrain primitive and terrain unit. The contour is first obtained by projecting terrain primitive and terrain unit onto the x-z plane. Then, k-DOP is used to simplify the contour into a set of vertices. k= 8 is appropriate in this work. Therefore the similarity is determined by
Figure 4: An illustration of controlling parameters of (a) terrain primitive and (b) terrain unit used for matching algorithm. procedure MatchingTU( TP){ // measure terrain cross-section similarity Φtp_p1∩tp_p2 = { TUi | |tu_l1l - tp_l1| ≤ δ1 & |tu_l2l - tp_l2l| ≤ δ2, TUi ∈ Φtu}; // measure mountain ridge similarity Φep = { TUi | |tui _p1–tp_p1| + |tui _p2–tp_p2| ≤ εep, TUi ∈ Φtp_p1∩tp_p2}; // measure terrain contour similarity Φ8DOP = { TUi | TUi _δ8DOP ≤ ε8DOP, TUi ∈ Φep}; TUo = TUi ∈ Φ8DOP; return; TUo; } 3.4. Terrain Unit Placement After obtaining the best match terrain unit, it must be placed on the constructing terrain to substitute for the terrain primitive. In addition to rotation and translation transformations applied for aligning to the terrain primitive, scaling transformation however must be performed occasionally to the terrain unit because its dimension might not be the same with the terrain primitive. Scaling doesn’t change the terrain appearance much because the matched terrain unit is the closest one by the similarity measurement rules. In general, many terrain primitives are used to construct the whole scene. Hence, these matched terrain units should be possibly joined together. To seamlessly
join them, the joint of two adjacent terrain units is partly overlapped, and a minimal cut approach is exploited to stitch this overlapped region. For every scanline in the overlapped region, we pick a cutting pixel which has the minimal elevation discrepancy among pixels in the same scanline. Pixels at the left (top) side to the cutting pixel in the scanline are selected from terrain unit at the left (top) side, and so do the right (bottom) side.
tives convey the overall macroscopic terrain in user’s mind consistently, the synthesized terrain is intuitively predictable. Also, the resultant synthesized terrain is realistic and reasonable because all terrain units are from real world. Figure 7 and Figure 8 demonstrate the synthesized mountain ridges using two and three terrain primitives respectively. It shows that each microscopic terrain feature can be effectively generated by a number of terrain
Figure 6: Terrain primitives and their matched terrain units. Top row: the hightfield map of user specified terrain primitives. Bottom row: the heightfield map of matched terrain units. Figure 5: (a) Terrain units join together without stitching. (b) Terrain units join together using the proposed minimal cut approach. (c) The heightfield map of (a). (d) The heightfield map of (b). Figure 5(a) shows two terrain units which join together without stitching. As you can see in the heightfield map of Figure 5(a), as shown in Figure (c), the discontinuity is apparent around the joint. Figure 5(b) displays two terrain units which are seamlessly joined together using the proposed minimal cut approach. The corresponding heightfield map of Figure 5(b), as shown in Figure (d), reveals no discontinuity around the joint. 4. EXPRIMENTAL RESULTS We have implemented ant tested the proposed approach on a PC with a processor of Pentium 4 2.4G and 1GB main memory. The graphic card is based on the chipset of GeForce FX 5600. All the codes were written in C++ and used OpenGL API. There are 698 terrain units, 458 external terrain units and 240 internal terrain units, segmented from real terrain elevation map of Taiwan in our terrain unit database. Figure 6 demonstrates heightfield maps of some matched terrain units with respect to the user specified primitives. Two types of terrain unit, external and internal terrain units, are used to test the effectiveness of our approach. As you can see in the Figure 6, the matched terrain units are very similar to the given terrain primitives in cross-section, mountain ridge, and terrain contour. Consequently, if user constructed terrain primitives convey the overall macroscopic
units. Moreover, several microscopic terrain features can be used to synthesize macroscopic terrain as shown in Figure 9. 5. CONCLUSIONS AND FUTUREWORKS In this paper, we use several microscopic feature terrains to synthesize macroscopic terrains. The proposed interactive environment provides an interface that user can intuitively and effectively depict features to construct terrain primitives which convey the profile of desired macroscopic terrain. By substituting the matched terrain unit for terrain primitive, the resultant synthesized terrain is realistic and reasonable because terrain units are segmented from terrain elevation map of real world. Without expensive computation on erosion and simulation used in the previous approaches, our approach is not only effective but also efficient. Future works include the automatically segmentation method for terrain units and more feasible stitching method for overlapped region of terrain units. We will exploit the elevation value and the distribution of terrain features to segment terrain units automatically. For seamlessly stitching terrain units, we would try to apply texture synthesis method to synthesize adjacent terrain units with high elevation discrepancy. REFERENCES [1]
[2]
Fournier, A. D., Fussell, D., and Carpenter, L., “Computer Rendering of Stochastic Models,” Communications of the ACM, Vol.25, pp. 371-384, 1982 Gardner, G. Y., “Functional Modeling,” SIGGRAPH
course notes, Atlanta, 1998 Lewis, J. P., “Generalized Stochastic Subdivision,” ACM Transactions on Graphics, Vol.6, No. 3, pp. 167190, July, 1987 [4] Mandelbrot, B. B., “Stochastic Models for the Earth’s Relief, the Shape and Fractal Dimension of Coastlines, and the Number Area Rule for Islands,” Proc Nat Acad [7] Mastin, G. A., Watterberg, P. A., and Mareda, J. F., “Fourier Synthesis of Ocean Waves,” IEEE Computer Graphics and Applications, Vol. 7, No. 3, pp. 16-23, March, 1987 [8] Miller, Gavin S. P., “The Definition and Rendering of Terrain Maps,” Computer Graphics, Vol.10, No.4, pp. 39-48, 1986 [9] Musgrave, F. K., Kolb, C. E. and Mace, R. S., “The Synthesis and Rendering of Eroded Fractal Terrains,” SIGGRAPH’89, pp. 41-50, July 1989 [10] Nagashima, Kenji, “Computer Generation of Eroded Valley and Mountain Terrains,” The Visual Computer, pp. 456-464, 1997 [3]
[5] [6]
[11]
[12] [13]
[14]
Sci USA 72:2825-2828, 1975 Mandelbrot, B. B., “The Fractal Geometry of Nature,” WH Freeman, New York, 1985 Marshall, Robert, Wilson, Rodger and Carlson, Wayne, “Procedure Models for Generating Three-Dimensional Terrain,” Computer Graphics, Vol.14, No.3, pp. 154162, 1980 Roudier, P., Peroche, B., and Perrin, M., “Landscapes synthesis achieved through erosion and deposition process simulation,” Computer Graph Forum (Eurographics 93), Vol. 12, pp. 375-383, 1993 Peitgen, H.O. and Saupe, Dietmar, “The Science of Fractal Images,” Springer, New York, 1988 Quinlan, S., “Efficient distance computation between non-convex objects,” IEEE Intern. Conf. on Robotics and Automation, pp. 3324-3329, 1994 Voss, Richard F, “Random Fractal Forgeries, Fundamental Algorithms for Computer Graphics,” Springer, Berlin Heidelberg New York, 1985
Figure 7: A mountain range is synthesized by two terrain primitives. The left image is the heightfield map of terrain primitives, the middle image is the heightfield map of terrain units, and the right image is the rendered image of synthesized terrain.
Figure 8: A mountain range is synthesized by three terrain primitives. The left image is the heightfield map of terrain primitives, the middle image is the heightfield map of terrain units, and the right image is the rendered image of synthesized terrain.
Figure 9: The synthesized macroscopic terrain.