a sketching interface for terrain …hiren/projects/...the object from given rendering. and new...

37
A SKETCHING INTERFACE FOR TERRAIN MODELING by Nayuko Watanabe A Senior Thesis Submitted to the Department of Information Science the Faculty of Science, the University of Tokyo on February 9, 2004 in Partial Fulfillment of the Requirements for the Degree of Bachelor of Science Thesis Supervisor: Takeo Igarashi Assistant Professor of Information Science

Upload: others

Post on 12-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

A SKETCHING INTERFACE FOR TERRAIN MODELING

手書きスケッチによる地形モデリング

by

Nayuko Watanabe

渡辺 奈夕子

A Senior Thesis

卒業論文

Submitted to

the Department of Information Science

the Faculty of Science, the University of Tokyo

on February 9, 2004

in Partial Fulfillment of the Requirements

for the Degree of Bachelor of Science

Thesis Supervisor: Takeo Igarashi 五十嵐 健夫Assistant Professor of Information Science

Page 2: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and
Page 3: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

ABSTRACT

Three-dimensional terrain models are used not only for geographical analysis but also for

entertainment application such as movies and video games. These applications do not

require exact numerical values for models. It is only necessary to make terrain model look

natural. However most existing methods for terrain modeling require precise numerical

control. Some systems allow the user to paint 2D height fields for terrain models, but

it is not easy to edit 2D height field appropriately to obtain a scene that has a specific

appearance from a given viewpoint.

We developed a system where the user can design the terrain model more intuitively. The

user edits 3D geographical model by drawing 2D strokes on the model directly. Whenever

a stroke is drawn, this system generates a terrain model whose silhouette conforms to the

stroke on the screen. The system also supports the construction of more natural look by

adding a noise.

論文要旨

3次元の地形データは地理的なデータ処理のみでなく、映画やビデオゲームなどにも使わ

れるようになっている。データの入力において、前者とは違い後者では厳密な数値の入力が

必要でなく、それらしいものを作ることができれば十分である。それにもかかわらず、現在

主流となっている方法は厳密な数値入力であり、直観的とは言えない。また、地面の高さを

上から見たマップで与えるという方法があるが、ある視点から見たときに特定の見かけをも

つような地形を作成するのは困難である。

そこで、3次元地形のデータを直観的に入力できるシステムを開発した。このシステムで

は 3Dの地形に直接 2次元ストロークを描いていくことでモデリングを行うことができ、ス

トロークを 1つ描くごとにストロークに合致した見た目の地形モデルを作ることができる。

これによってユーザーは 2次元の絵を描く感覚で地形のモデリングを行うことが可能になる。

地形はただストロークに合致しているだけでなく、ノイズを加えることで自然に見えるよう

になっている。

Page 4: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Acknowledgements

We would like to thank to our thesis Supervisor Takeo Igarashi for his support

in doing this work. He gave us many hints, useful advice about this thesis. We

also would thank members of Igarashi laboratory. It was not possible to complete

this work without their encouragement.

Page 5: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Contents

1 Introduction 1

2 Related Work 3

2.1 3D modeling from 2D input . . . . . . . . . . . . . . . . . . . . . . . 3

2.2 Terrain modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.3 Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 User Interface 9

4 Implementation Detail 18

4.1 Data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.2 Terrain modeling from 2D input . . . . . . . . . . . . . . . . . . . . 18

4.2.1 Stroke recognition of mountain . . . . . . . . . . . . . . . . . 19

4.2.2 Stroke recognition of river . . . . . . . . . . . . . . . . . . . . 23

4.3 Noise addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5 Result 25

6 Limitations and Discussion 28

7 Future Work 29

i

Page 6: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

List of Figures

1.1 Overview of the system . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.1 Terragen : input (height-field) and output . . . . . . . . . . . . . . . 4

2.2 Composition of noise function in Perlin noise [8] . . . . . . . . . . . 7

3.1 First view of the system . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.2 Stroke(upper) and top view of mountain(lower) . . . . . . . . . . . . 10

3.3 Stroke which has neither local maximum nor minimum point . . . . 11

3.4 Stroke which has one local maximum point . . . . . . . . . . . . . . 11

3.5 Stroke which has two or more local maximum and local minimum

point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.6 Round and sharp stroke and mountains generated by these strokes . 13

3.7 Creating a river . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3.8 Stroke of a river over the mountain and bridging gaps . . . . . . . . 14

3.9 Strokes and mountain generated by the strokes . . . . . . . . . . . . 15

3.10 Effect of noise addition on existing terrain . . . . . . . . . . . . . . . 17

4.1 Terrain modeling from 2D input . . . . . . . . . . . . . . . . . . . . 19

4.2 altitude of mountain . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

4.3 Filling a gap between start and end point . . . . . . . . . . . . . . . 21

4.4 Stroke and foot of mountain generated by the stroke . . . . . . . . . 22

4.5 Stroke and altitude of mountain generated by the stroke . . . . . . . 23

5.1 Terrain drawn by author . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.2 Terrain drawn by test users . . . . . . . . . . . . . . . . . . . . . . . 27

ii

Page 7: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Chapter 1

Introduction

Three-dimensional terrain modeling requires considerable labor for data entry.

One reason is that designer is required to enter numerical values, and another is

that he or she is unable to do modeling interactively. The designer must input

numerical values, render the scene, adjust values, and repeat these operations.

We therefore develop a pen-based system that reconstruct a terrain from novel

viewpoints, given the terrain drawn in two-dimension from a single point of view.

There are many researches about 3D modeling from 2D input [7] [5] [15] [10].

Among them, Harold excels at ability of modeling terrain [6].

We extend Harold’s algorithm to recognize strokes used for terrain modeling,

producing more natural terrain model. In our system, strokes are projected to the

vertical plane interpolating the first point on the ground. and then the system

generates a terrain model whenever a stroke is drawn. In the terrain model, whole

slope of mountain reflects the shape of corresponding stroke. The user draws a

stroke like in Figure 1.1(a) and gets terrain model such as Figure 1.1(b).

We add noise to the terrain model so that the terrain looks natural. Simple

random noise however at times does not look natural. Fractals are more suitable

for natural object whereas they take time to generate. So we use noise function

developed by Perlin [8] that is able to generate fractal-like noise. Perlin Noise is

a noise function that adds noises with various frequencies and amplitudes. This

noise function generates very natural noise.

1

Page 8: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) The user’s stroke (b) A mountain generated by the

stroke

Figure 1.1: Overview of the system

We can draw terrain intuitively and interactively, and make a terrain model “look

natural.”

The rest of this thesis is organized as follows. Related work section mentions 3D

modeling from 2D input, terrain modeling, and noise function. Interface section

explains how to use our system. In implementation detail section, we describe

data structure for terrain model, stroke recognition algorithm, and noise addition

algorithm. Limitations and discussion section describes problems of our method,

and in future work section we provides solution to limitations and directions for

future work.

2

Page 9: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Chapter 2

Related Work

This chapter describes related research in 3D modeling from 2D input, terrain

modeling, and noise functions.

2.1 3D modeling from 2D input

A typical procedure for geometric modeling is to start with a simple primitive

such as a cube or a sphere, and gradually construct a more complex model through

successive transformations or a combination of multiple primitives.

Today, interactively constructing 3D objects and scenes from 2D input is an

active research area. Cohen et al. described this approach as the inverse of tradi-

tional computer graphics [6]. The system tries to construct a geometric model of

the object from given rendering. And new renderings can then be obtained from

arbitrary viewpoints.

Quick-sketch is a 2D and 3D modeling tool for pen-based computers [7]. The

user is able to sketch 3D solid objects and B-spline surfaces in Quick-sketch, by

sweeping a 2D profile along a straight line (solid objects) or interpolating between

two curves (B-spline surfaces). For modeling 3D curves, there is a method using

shadow drawing [5].

The SKETCH allows the user to create a 3D object by drawing as 2D represen-

tation in similar way to draw with a paper and a pencil [15]. Teddy is the system

3

Page 10: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) Input to ter-

ragen

(b) Output of terrain

Figure 2.1: Terragen : input (height-field) and output

that constructs 3D geometric object from 2D free form strokes/gestures interac-

tively and intuitively [10]. Cohen developed Harold by which the user can draw

3D world and explore in the world [6]. Harold can do terrain modeling interac-

tively. We can explore and expand 3D world in Harold by drawing 2D strokes. A

drawback of Harold is that the generated mountains tend to be thin.

Modeling natural objects is difficult because of their complexity. Okabe et al.

modeled 3D tree from 2D strokes [13]. Tree modeling requires the adjustment of

parameters and randomization, in addition to stroke recognition. This is similar

to terrain modeling, however tree modeling algorithm cannot be applied to terrain

modeling.

Elevation grids are frequently used for data structure of terrain model. We use

it for reasons of its simplicity and versatility. TerragenTMis a software for terrain

modeling using an elevation grid [14]. The user gives 2D height field, and it become

height of grid. Figure 2.1(b) is output of Figure 2.1(a) with view point placed in

the south. A limitation of this is unable to specify the height interactively.

2.2 Terrain modeling

Terrain generation mainly produces a height map (a 2D array of height values),

then uses the map to draw the actual terrain. Methods to create a height map

4

Page 11: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

are generating algorithmically or using real data. There are many algorithms that

generate terrain model algorithmically such as Fractional Brownian motion [4],

area subdivision (midpoint displacement) [3], function composition and real world

based approaches.

The key concept of fractional Brownian motion, area subdivision, and function

composition is self-similarity (fractal). An object is said to be self-similar when

magnified subsets of the object look a rough or fragmented geometric shape that

can be subdivided in parts, each of which is (at least approximately) a smaller

copy of the whole. Fractals are mathematical functions proposed by Mandelbrot

to describe natural phenomena such as coast lines, mountains, branching patterns

of trees and rivers, clouds, and earthquakes.

Fractional Brownian motion (called fBm) [4], area subdivision [3] and function

composition [8] are algorithms for creating self-similar pattern automatically. The

fBm expresses mountains’ vertical section form by using fact that behavior of Brow-

nian motion is similar to the form of mountains. Area subdivision (or midpoint

displacement) is a recursive approach. It is not fractal in a precise sense but is

a fractal-like method. In one dimension, it takes a horizontal line segment, finds

midpoint, then displaces it by a random amount, and repeat these operations. Area

subdivision has been used by N.Wiener in 1920’s in order to create Brownian mo-

tion. And its efficiency of the calculation is higher than fBm’s efficiency. There are

many algorithms that process more or less the same way as area subdivision. For

instance, Diamond Square algorithm, the Fault algorithm, Circle algorithm, and

Hill algorithm. A drawback of these methods is that the computation is dynamic,

and it is impossible to directly compute the height of a point.

The function composition algorithms use functions to generate curve and com-

pose them to form the surface. And it is similar to Fourier. The algorithms

evaluate functions at each point of surface, repeating with lower amplitude, higher

frequency for several octaves. There are two classic algorithms: Brown noise and

Perlin noise [8]. Details of these noises are described in the next noise section 2.3.

In this section, we mention terrain generated by using these noises.

5

Page 12: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Brown noise which follows fBm generates results that are highly correlated and

good for mountains. Perlin noise can generate terrain more easily as well as tex-

tures. Its advantage is that the height at a given point is calculated without need

of storing it in memory like subdivision methods. Many computer-generated land-

scapes use Perlin noise.

Other direction of generating terrain model is using real data [11] [9] [2]. An ap-

proach is generating 3D model from 2D map with contours, by using a data struc-

ture TIN (Triangulated Irregular Network). TIN is a vector-based structure, which

treats topographic surface as a surface consisting of number of non-overlapping tri-

angles. TIN can render various geographical features that is impossible to render

with DEM (Digital Elevation Model).

2.3 Noise

Many people have used random number generators in their programs to create

unpredictability, make the motion and behavior of objects appear more natural, or

generate textures. At times, random number generators’ output can be too harsh

to appear natural. On the other hand, there are many noise functions besides white

noise whose power density is constant over a finite frequency range. Color noises

[1] are used in data transmission: white noise, pink noise, red noise, orange noise,

green noise, blue noise, purple noise, grey noise, and black noise. Brown noise is also

used for terrain modeling. “Brown” does not means the color brown and the name

comes from Brownian motion which produces random signals with the spectrum

that has a falloff of 6dB/octave. It is called “random walk” or “drunkard’s walk”

noise.

Perlin noise [8] composes noise functions generating curve at a range of different

scales. See Figure 2.2. Noise functions (Figure 2.2(a)-2.2(e)) that have various

amplitude and frequency are composed and Figure 2.2(f) is output. The output

shows large, medium and small variations and looks a little like a mountain range.

1D output is shown but Perlin noise can make 2D noise.

6

Page 13: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) (b) (c)

(d) (e) (f)

Figure 2.2: Composition of noise function in Perlin noise [8]

7

Page 14: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

We use Perlin Noise in order to add noise to a given terrain.

8

Page 15: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Chapter 3

User Interface

We now describe the system from the user’s point of view. Initially the system

shows a “ground” which is a planar region of the xz-plane (Figure 3.1).

Figure 3.1: First view of the system

The interaction operation in this system is drawing with a stylus pen. A mouse

can also be used. The user occasionally clicks buttons or moves slide bars. There

are some buttons: undo, redo, clear, noise initialization, save BMP. And there is a

checkbox to switch whether adding noise or not. Two slide bars are for adjusting

noise parameters.

We explain how to use our system in detail. The user first draws a stroke by

dragging the cursor with the pen or mouse. When the button is released (or pen

9

Page 16: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Figure 3.2: Stroke(upper) and top view of mountain(lower)

is released), a mountain is generated. The stroke is interpreted as the ridge of a

mountain.

The horizontal extent of a generated mountain corresponds to the length of the

stroke’s shadow (Figure 3.2). In this figure, upper area shows a 2D stroke drawn

by the user, and lower area shows top view of mountains generated the stroke.

When user’s stroke has neigher local maximum point nor local minimum point

except for the start and end point of the stroke, a bump between the start and end

point of the stroke is generated (Figure 3.3).

When user’s stroke has only one local maximum point, a mountain is generated

(Figure 3.4).

10

Page 17: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) Stroke which has nei-

ther local maximum nor

minimum point

(b) Terrain generated by

the stroke

(c) Terrain with noise

Figure 3.3: Stroke which has neither local maximum nor minimum point, and a

bump generated by the stroke

(a) Stroke which has one

local maximum point

(b) A mountain generated

by the stroke

(c) A mountain with noise

Figure 3.4: Stroke which has one local maximum point, and a mountain generated

by the stroke

11

Page 18: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Otherwise, two or more mountains are generated (Figure 3.5).

(a) Stroke which has two

or more local maximum

and local minimum point

(b) Mountains generated

by the stroke

(c) Mountains with noise

Figure 3.5: Stroke which has two or more local maximum and local minimum point,

and mountains generated by the stroke

Form of the mountain generated corresponds to form of stroke (Figure 3.6).

When user’s stroke is round / sharp, whole mountain is round / sharp.

If there is a height gap between start and end point of user’s stroke, our system

fills the gap by adjusting height of terrain.

View point can be changed by dragging with the shift key pressed.

A river can be created by pressing a control key while drawing a stroke. The

stroke should be drawn on the ground (see Figure 3.7). If the user’s stroke runs

a silhouette of the terrain, the system bridge any gaps with curves that look from

above like straight line segments (see Figure 3.8).

If the computer without a keyboard is used, shift and control keys are replaced

by the function of “View”, “Terrain”, “River” buttons. After buttons are pressed,

a stroke is drawn. Then mode returns to the terrain mode.

The user can repeat these operations to obtain scene with various mountains.

Figure 3.9 shows an example. First, a stroke is drawn (Figure 3.9(a)) and moun-

tains are generated (Figure 3.9(b)). The next stroke is drawn on the mountains,

that starts on the ground beyond the mountains (Figure 3.9(b)). The user then

obtains a mountain and draws the next stroke in front of the mountains (Figure

12

Page 19: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) Round stroke (b) Sharp stroke

(c) A mountain generated (d) A mountain generated

(e) A mountain with noise (f) A mountain with noise

Figure 3.6: Round and sharp stroke and mountains generated by these strokes

13

Page 20: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) A stroke drawn on

the ground

(b) A river generated

by the stroke

(c) Top view of the

river

Figure 3.7: Creating a river

(a) A stroke drawn over the

mountain

(b) Top view of the river

Figure 3.8: Stroke of a river over the mountain and bridging gaps

14

Page 21: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) First stroke (b) Mountains generated by a stroke in

Figure 3.9(a) and second stroke

(c) Mountains generated by a stroke in

Figure 3.9(b) and third stroke

(d) Mountains generated by a stroke in

Figure 3.9(c)

Figure 3.9: In Figure 3.9(a)-3.9(c), strokes are drawn, and by these strokes moun-

tains are generated (Figure 3.9(d))

15

Page 22: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

3.9(c)). These three strokes generate mountains in Figure 3.9(d).

Optionally, the user can add noise to make the terrain look natural. It is simply

done by clicking a check box. The noise is controlled by two slide bars. The

“strength of existing terrain” is for setting how strongly existing terrain effects.

The smaller it is, the flatter the terrain become. The “strength of noise” is for

setting how strongly noises affects. When its value is large, noise becomes harsh.

See Figure 3.10. Noise of various strength is added to original terrain (Figure

3.10(a)). In this way, one can obtain mountains with various smoothness of surface

starting from the same original terrain. Our system can also add colors to terrains.

16

Page 23: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) Original terrain

(b) Weak original terrain and

weak noise

(c) Strong original terrain

and strong noise

(d) Week original terrain and

strong noise

(e) Strong original terrain

and week noise

Figure 3.10: Effect of noise addition on existing terrain

17

Page 24: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Chapter 4

Implementation Detail

4.1 Data structure

We first describe our data structures. The data consists of a geometry of a

ground surface, strokes of mountain, and noise map.

A ground surface is built by using a grid-based DEM (Digital Elevation Model).

Grid-based DEM consists of a raster grid of regularly spaced elevation values.

There are some reasons to use grid-based DEM; easiness and simplicity of im-

plementation. Grid-based DEM is appropriate for real time application because

complex computation is not required. Additionally, each gridpoint stores the cor-

responding height of strokes and a flag for a river.

Each stroke of mountain is a sequence of 3D points, and has two height maps of

mountain generated by this stroke. One map is for height of inside of the stroke,

the other is for height of outside of the stroke. These data are created every time

one stroke is drawn.

Noise map is a grid-based DEM whose range of height is from -0.5 to 0.5. This

noise is generated by Perlin Noise function [8] at the beginning.

4.2 Terrain modeling from 2D input

In this section, we explain method for recognizing strokes.

18

Page 25: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

4.2.1 Stroke recognition of mountain

There are 5 steps to complete recognizing a stroke for mountain (Figure 4.1).

Step 1, we project the start point of 2D stroke to the ground surface. Step 2,

heights of other points of 2D stroke are determined. As a result of Step 2, there

is a gap between heights of the start point and the end point of the stroke. We

fill this gap in Step 3. In Step 4, a foot of mountain is determined. Finally, we

complete mountains in Step 5.

(a) Step 1 (b) Step 2 (c) Step 3 (d) Step 4 (e) Step 5

Figure 4.1: Terrain modeling from 2D input

Step 1 : 2D points to 3D points

A stroke for generating mountain is sequence of 3D points. The user inputs

sequence of 2D points, so we have to convert the 2D points to 3D points. We will

call the 2D point P , and assume that P is converted to 3D point P ′. A 2D point is

projected to 3D ground surface as follows. Four points of each grid are projected to

2D screen, and make quadrangle. We check whether each projected 2D quadrangle

contains P in descending order of distance of grid from view point. And coordinate

of P ′ is coordinate of 3D grid whose projected quadrangle contains P at the end.

Step 2 : Altitude of mountain

A sequence of 2D points is projected to a plane.

The plane is perpendicular to the horizontal plane and interpolates the first 3D

point of sequence S0. The first point of 2D sequence S is projected to ground

19

Page 26: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

surface by using above method (Step 1). And we will call this projected 3D point

S0. Other points of sequence are projected to the plane as follows.

Figure 4.2: Altitude of mountain : surface N is plane of projection moved so that

it corresponds to xz-plane, surface N ′ is plane to which the stroke is projected.

V is view point moved, S is start point of the stroke, and P is the point on the

stroke.

We’ll denote a 2D point that we want to project to the plane as P . At the

first, we move & rotate S0 in a such way that the view screen corresponds to the

xz-plane, and line of vision to y-axis. As a result, S0 is moved to S′ and view point

moved to V (see Figure 4.2).

Next, we solve

−−→V P ′ · −−→S′P ′ = 0

m−→P =

−→P ′

and get P ′ which is a 3D vector. The ”surface N” is 2D screen. Then, P ′ is

rotated and moved in a such way that the view screen and line of vision return to

where they were.

Stroke is separated by local maximum points and local minimum points. We

denote this separated strokes as s0, s1, s2, . . . , sn, and distance on xz-plane between

20

Page 27: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Figure 4.3: Filling a gap between start and end point

P1 and P2 as d(P1, P2). Start point and end point of the stroke are projected on

the ground, and denoted as S, T .

Step 3 : Height gap between start and end point

If there is a height gap between start and end point of user’s stroke, our system

fills the gap.

In order to fill the gap, we define a diameter and determine height of a point P .

Let the point PST be on S′T ′ (S′T ′ is ST projected to ground) so that S′T ′ and

PPST are perpendicular. Height of P is

h(P ) = v0t(1− t)2 + v1(2t + 1)(1− t)2 + v2t2(3− 2t)− v3t

2(1− t);

When PST lays between S′ and T ′, t = d(P, S′T ′)/diameter. v0 and v3 are

gradient of S and T . If PST does not lay outside segment S′T ′ and T is nearer to

P than S, t = d(P, T ′)/(diameter + h(T )). v1 is height of point whose distance

from the segment S′T ′ or S′ or T ′ is the diameter, v2 is height of ST or S or T

(Figure 4.3). This expression enables height to interpolate v1 and v2, and gradient

at S and T to correspond with v0 and v3.

Step 4 : The foot of a mountain

We determine the foot of a mountain created by the stroke.

21

Page 28: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

If the stroke has neither local maximum point nor local minimum point, the

length of foot of mountain from stroke (projected to plane) is the height of stroke

(Figure 4.4(a)).

Next we explain the case that the stroke has local maximum point or local

minimum point. Let E a point which is foot of a perpendicular to a point F laying

in segment si. Segment si has own start point psi and end point pt

i, we assume that

psi is higher than pt

i. If d(F, ps) is less than 0.5 (the distance of between F and ps

is shorter than that between F and pt),

d(F, E) = v0t2(1− t) + v1t

2(3− 2t) + v2(2t + 1)(1− t)2

where t is d(F, pti)/d(ps

i , pti), v1 is height of pt

i, and v2 is (d(psi , p

ti)+d(ps

i , pti−1))/2

(if si−1 exists). v0 is v2 ∗ 2, if si−1 exists (see Figure 4.4(b)). This expression is

similar to Hermite curve, height is continuous at t = 0 and t = 1.

(a) (b)

Figure 4.4: The stroke and foot of mountain generated by the stroke. Distance

between F and E is determined by t and length of si−1, si, and si+1.

In the case that the distance of between F and pt is shorter than that between

F and ps, we compute d(F, E) using si+1 in similar way.

22

Page 29: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Step 5 : Completion of mountain

We compute height of a point P laying between F and E as follows. Let u =

d(F, P )/d(F, E). We explain only the case that the distance of between F and ps

is shorter than that between F and pt. In other case, we are able to compute in

similar way by displace ps and si−1 with pt and si+1. Let h(Ui) height of a point Ui,

the distance d(psi , Ui) = u× d(ps

i , pti). And let h(Ui−1) height of Ui−1, the distance

d(psi , Ui−1) = (1 − u) × d(ps

i−1, pti−1) (note that ps

i and pti−1 are the same points)

(see Figure 4.5). Altitude of P is average height of h(Ui) and h(Ui−1), that are

normalized so that altitude may be height of the stroke in u = 0 and 0 in u = 1.

Figure 4.5: The stroke and altitude of generated by the stroke. Height of P is

determined by u

4.2.2 Stroke recognition of river

For a stroke specifying a river, all 2D points are projected to the ground surface

by using above (2D points to 3D points) method. As a result, there is a sequence

of 3D points. The corresponding point in the boolean map is set to be true.

When the user’s stroke goes from the front terrain to the back terrain, the

23

Page 30: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

projection of the stroke onto the ground terrain is discontinuous. We describe

the last point on the front terrain as A, and the first point on the back terrain as

B. Then A and B is bridged on the xz-plane. y coordinate of the point between A

and B is a unique value, because our terrain is a height field.

4.3 Noise addition

Original terrain is generated by drawing strokes. The user is able to add noise

on this existing terrain model. A noise map is created by using Perlin Noise, and

consists of elements whose values are in the -0.5 to 0.5 range.

We assume that we add noise to point (i, j), and denote h(x, y) as height of point

(x, y), noise(x, y) as value of point (x, y) on the noise map. Height of point(i, j) is

computed as follows,

h(i, j) = noise(i, j)× noise strength + a(i, j)

a(i, j) = 16(hi−1,j + hi+1,j + hi,j−1 + hi,j+1) + 1

12(hi−1,j−1 + hi+1j + 1 + hi−1,j+1 + hi+1,j−1)

hx,y is height of point whose distance from (i, j) is noise(x, y)× strength of

existing terrain.

24

Page 31: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Chapter 5

Result

Our prototype system is developed with 250 × 250 array of height. It is imple-

mented on Java TMversion 1.4.2. The author and test users generated terrain by

using our system. Figure 5.1 shows sample terrain models designed on our system

by the author, and Figure 5.2 shows terrain models designed on our system by the

test users. The caption indicates times taken to model.

We asked users to use our system and provide some comments. The following is

the comments by the test users.

• When dragging on the area where there is none, view point should be slided.

• There should be smoothing tool.

• It is desired to be able to design concave terrain.

• The stroke of mountain should affect only to local area.

• Rivers should be physically possible.

• It is easier to model terrain using this system than existing modeling tool,

for example, LiteWave [12].

• It is joyful that the user can model fantastical terrain.

25

Page 32: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) in 7 minutes (b) in 8 minutes

(c) in 10 minutes (d) in 5 minutes

Figure 5.1: Terrain drawn by author

26

Page 33: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

(a) in 10 minutes (b) in 7 minutes

(c) in 10 minutes (d) in 14 minutes

(e) in 15 minutes

Figure 5.2: Terrain drawn by test users

27

Page 34: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Chapter 6

Limitations and Discussion

Main drawback of our system is that at times forms of generated mountains are

not intuitive. Firstly, generated mountains are symmetric on the strokes which

are drawn in order to create the mountains. It is because that their height are

computed by using the same algorithm at the symmetric points on the strokes.

Secondly, mountains are, furthermore, not eroded and their roots are too smooth.

As a result, this system is hard to create eroded mountains that are typical be in

Japan. Finally, when a stroke is drawn in order to continuous mountains, if height

of local minimum points are too high, foot of mountains become unnatural.

For rendering, flat shading is applied. This shading is not realistic because

there are rapid changes on border lines of polygons. If the designer wants realistic

rendering, he or she have to use application specialized for rendering.

28

Page 35: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

Chapter 7

Future Work

Our current algorithm can fail or generate appropriate results when the user

draws unexpected strokes. For instance, user’s stroke may imply rings, or return

to a point which has same x, y-coordinate as previous point of the stroke. And we

must devise more robust and flexible algorithms to handle a variety of user inputs.

An obvious direction for future work is to develop additional modeling opera-

tions to support other geographical features. Our current system supports only

mountain and river modeling. We will support other geographical features, for

example, valley, cliff, and cave. Eroding needs to be implemented for more natural

mountains. In order to create caves, however, other data structure is required.

There are many possible extensions to the rendering system. One example is to

add automatic level-of-detail for terrain in order to speed up the rendering system.

Another is to support non-photorealistic rendering style such as Harold [6] and

Teddy [10] so that our system are used for variable goal, for example, modeling

terrain in computer graphics of games. Currently, ground surface is only colored,

but in the future texture mapping will be done.

29

Page 36: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

References

[1] Kevin Bolding. Noise types. http://myhome.spu.edu/bolding/EE3550/resources/Noise

Types.htm.

[2] Jan Burdziej. Gis and 3dimensional digital terrain modeling.

www.geo.uni.torun.pl.

[3] B.マンデルブロ. フラクタル幾何学. 日経サイエンス, 1985.

[4] Philippe Carmona and Laure Coutin. Fractional brownian motion and the

markov property. In Electronic Communications in Probability, pages Vol.3

no.12 p.95–107, 1998.

[5] J.M. Cohen, L. Markosian, R.C. Zeleznik, J.F. Hughes, and R. Barzel. An

interface for sketching 3d curves. In 1999 Symposium on Interactive 3D Graph-

ics, pages 17–21, 1999.

[6] Jonathan M. Cohen, John F. Hughes, and Robert C. Zeleznik. Harold: A

world made of drawings. In To appear in Proceedings of NPAR 2000. ACM

NPAR, 2000.

[7] Lynn Eggli, Ching yao Hsu, Beat D Bruderlin, and Gershon Elber. Inferring

3d models from freehand sketches and constraints. Computer-Aided Design,

pages 29(2): 101–112, 1997.

[8] Hugo Elias. Perlin noise. http://freespace.virgin.net/hugo.elias/models/m perlin.htm.

[9] Chistopher Gold and Maciej Dakowicz. Terrain modelling from contours.

www.voronoi.com.

30

Page 37: A SKETCHING INTERFACE FOR TERRAIN …hiren/projects/...the object from given rendering. And new renderings can then be obtained from arbitrary viewpoints. Quick-sketch is a 2D and

[10] Takeo Igarashi, Satoshi Matsuoka, and Hidehiko Tanaka. Teddy: A sketching

interface for 3d freeform design. In SIGGRAPH 99 Conference Proceedings,

pages 409–416. ACM SIGGRAPH, 1999.

[11] Kazufumi Kaneda, Fujiwa Kato, Ehachiro Nakamae, Tomoyuki Nishita, Hideo

Tanaka, and Takao Noguchi. Three dimensional terrain modeling and display

for environmental assessment. In Computer Graphics, pages 23(3): 207–214.

ACM SIGGRAPH, 1989.

[12] NewTek. Litewave. http://www.newtek.com/products/lightwave/index.php.

[13] Makoto Okabe and Takeo Igarashi. 3d modeling of trees from freehand skeches.

In SHIGGRAPH 2003 conference on Sketches & applications. ACM SIG-

GRAPH, 2003.

[14] Planetside Software. TerragenTM. http://www.planetside.co.uk/.

[15] Robert C. Zeleznik, Kenneth P. Herndon, and John F. Hughes. Sketch: An

interface for sketching 3d scenes. In SIGGRAPH 96 Conference Proceedings,

pages 163–70. ACM SIGGRAPH, 1996.

31