• 沒有找到結果。

Generation of Streamlines

Texture Strokes Construction with 3-Dimension Terrain

7.3 Generation of Streamlines

A direction field on the surface should be chosen for streamline generation. A natural geometric candidate is the pair of principal curvature direction fields [6, 41]. Ohtake et al. [28]

presented adaptive smoothing tangential direction fields on a polygonal surface. Ohtake’s method effectively simulated pen-and-ink drawings of 3D objects. However, Chinese landscape painting seeks to simulate the surface texture of a terrain. The basic idea of generating streamlines is adjusted for applying texture strokes.

7.3.1 Streamlines

Given a triangulated surface and the principal curvature directions at each vertex, the weighted averaging scheme repeatedly and simultaneously updates each vertex direction by calculating the weighted sum of the directions. Selecting such a weight smooth the direction field and maintains the coherence of the reference direction. The reference direction is the gravity direction of the terrain. DEM is a grid field of height, so for any vertex P (Px,Py,Pz), Py

is the height of the vertex. Figure7.1 displays a triangular mesh F with normal vector Fr

n.

63

-Moreover, Gr denotes the direction of gravity (0,-1,0). Let the projection of vector onto F. Finally, the vector t(P) is the initial principal direction

estimated at the vertices of the mesh ,

Figure 7.1: The reference direction Gr

ref of an mesh F. raindrop were to fall on surface F, it would flow along the streamline direction t(F).

Once the streamline direction field is smoothed by the reference direction, a direction field t(F) is defined on the face of every triangle mesh. An initial point inside a triangle is selected, and the streamline is traced from the point, according to Sk+1=Sk +ρt(Fk), whereρ is a real number such that the line meets the edge of the triangle. Moreover, Sk+1 is located on the edge of the triangle. The tracing of the streamline ends when the streamline direction conflicts with another streamline direction of the neighboring triangle, as shown in Figure 7.2, where the streamline stops at a ravine. Each triangle mesh can generate one streamline.

64

-Figure7.4(b) depicts the resulting stroke streamlines obtained by this method.

The segments of Si are defined by segment(Si), which is number of triangles through which Si passes. For example, segment(S) is 9 in Figure 7.2. The average of segment(Si) of a

terrain is defined by , where n denotes the number of

triangular meshes of a terrain. Normally, the number of iterations required for smoothing is AVG(S).

Figure 7.2: An example of streamlines generation t(Fi)

The following steps are performed to determine whether a mesh F is a ridge mesh of a terrain model. (1) Locate all the streamlines; every triangle generates one streamline, which does not stop until it meets the ravine; (2) Compute the number of streamlines Stotal(Fi) that pass through the triangle mesh Fi; (3) specify a threshold Sthreshold: if the number of streamlines

65

-Stotal(Fi)Sthreshold. Then, Fi is a ridge triangle mesh. Let Ridge(F) represent a set of triangle meshes, Ridge(F) = { Stotal(Fi) Sthreshold; 0 in, where n is the number of triangle meshes of a terrain}. Normally, the mesh of the mountain peak only generates one passing streamline ( Stotal(Fpeak) 1 ). Figure7.3(c) plots the streamlines generated using ridge meshes. The ridge triangle mesh is extremely important for rendering lotus-leaf texture strokes.

7.3.3 Level of Detail

The level of detail (LOD) modeling method is an effective approach for interactively visualizing complex terrain models. When the terrain is so far away that it only occupies one pixel, there is very little use in modeling the terrain in high detail. Figure 7.3(a) plots all streamlines without LOD, the entire streamlines do not need to be displayed in significant detail because they may be obscured by a visible piece of the model, or be far enough away to make the detail meaningless. A large number of researchers have developed algorithms for approximating terrains and other height fields using polygonal meshes. Taylor and Barrett [40]

extract mesh approximations from rectangular quad-tree hierarchies. Both Lindstrom et al. [22]

and Duchaineau et al. [5] define binary-tree hierarchies based on binary subdivision of right isosceles triangles, and demonstrate real-time view-dependent LOD. In the proposed approach, the number of strokes to be shown is determined with the LOD. For each initial vertex Pi of streamline Si, Depth(Pi) represents the depth value of Pi . Based on the Depth(Pi) value, look up the hierarchical tree which streamline Si is selected or not. The streamlines are completely visible only when close to the viewer. Figure7.3(b) depicts the stroke streamlines using LOD.

LOD is creating an impression of viewing distance when rendering terrain. The depth value also influences the width of the streamline brush stroke.

66

-(a) Streamlines without LOD (b) Streamlines with LOD (c) Streamlines from ridge mesh

Figure 7.3: Examples of streamlines rendering with three different conditions

7.3.4 Brush Stroke of Streamlines

In order to generate brush strokes on the rice paper, the models of the previous work are utilized [39, 45, 46]. In this section, only explain the brush strokes of streamlines briefly.

The stroke of streamline is applied using a precise and flexible Cardinal spline. Cardinal spline is an interpolated but not approximated curve, which passes through all the specified control points. All points of one streamline can be selected as control points. Cardinal spline facilitates slackness control by adjusting parameter t , with a smaller t implying a slacker curve. Figure 5.5 illustrates the precision and flexibility of the Cardinal spline. The brush stroke line can be either softened or hardened.

7.3.5 Frame Coherence

Frame coherence is an important issue in NPR related research. If stroke placement and style differ significantly between two consecutive frames, coherency problems will result. Since streamlines are constructed during a preprocess step, the position of each streamline is fixed.

Furthermore, stroke parameters such as the size of the brush, the number of bristles, the

67

-decreasing rate of ink, water, and so on, are preserved. When strokes are applied at each frame, each stroke is guaranteed to have the same position and stroke parameters.

(a) Wireframe (d) Outline drawing

(b) Hemp-fiber stroke streamlines (e) Hemp-fiber texture strokes

( c) Smooth shading with fog (f) Hemp-fiber texture strokes Figure 7.4: The procedure of Hemp-fiber texture strokes

68

相關文件