• 沒有找到結果。

CHAPTER 4 GENERATION OF TEXTURE MAPPING

4.3 Cells Mapping

4.3.2 Texture Mapping on Model

In this subsection, we process triangles of the model separately to map textures.

At first, we search the cells which intersect the bounding box of a triangle. Then we consider the intersection between these cells and a triangle. If a triangle is inside one cell completely, we use the mapping function of the cell to map textures onto it. If not, we need to acquire the intersectional points by detecting a triangle with the cells.

There are two kinds of points between a triangle and a cell described as follows:

1. Three edges of a triangle and six surfaces of a cell

2. Twelve edges of a cell and the interior of a triangle

Figure 4.11 A triangle is subdivided into four slices by a cell

Some intersectional points are increased in the triangle. A triangle is subdivided into several slices by cells and each slice is included in a cell. An example is shown in Figure 4.11. Then we separately process each slice to map textures onto it according to the mapping function of the cell which includes it.

An interior point of a triangle A point in the edge of a triangle

Four slices of a triangle A triangle and four unit cells

Finally, we accomplish to map textures of the polycube onto the slices which belong to all triangles of the model. And this algorithm is able to reduce distortion.

Chapter 5

Implementation and Results

In this chapter, we demonstrate our implementation results. The input sources are a texture and a 3D model. Our algorithm are implemented in C# language on VC.Net with a Pentium4 3.4GHz PC with 2 GB memory.

(a) (b)

Figure 5.1 (a) example 1: an input texture and (b) a laruana model

An input example with a 183x100 texture image and a laurana model are shown in Figure 5.1. An intermediate result is the polycube of the model with unit cubes, as shown in Figure 5.2(a). Figure 5.2(b) shows that the relation between the polycube and the model. They are intersecting with each other. Figure 5.2(c) shows the polycube with tiled textures and Figure 5.2(d) shows that an image is enlarged from

Example 1

the yellow region in Figure 5.2(c). Each tile is combined by graph cuts algorithm. The final result is shown in Figure 5.3. And Figure 5.5 shows another result with different texture sample.

(a) (b)

(c)

Figure 5.2 (a) a polycube of the laruana model, (b) relation between the polycube and the model, (c) polycube with the tiled textures and (d) an enlarged image

(d)

(b)

(c)

Figure 5.3 (a) Textures map onto the model, (b) and (c) are enlarged images form the portions of (a)

(a)

Figure 5.4 shows a result of Fu and Leung [9]. Table 5.1 shows the comparison with our result.

Table 5.1 Comparison between our result and Fu and Leung [9]

Our algorithm Fu and Leung [9]

Size of a unit cube Small Large

Number of unit cubes Many Few

Size of patterns Small Large

(b)

Figure 5.4 (a) a polycube of the laruana model [20] (b) a result of the laruana model in Fu and Leung [9]

(a)

(b)

(c)

Figure 5.5 A mapping result with the texture example 2, (b) and (c) are enlarged images

Example 2

(a)

Table 5.2 shows the information of Figure 5.3 and 5.5.

Table 5.2 Information during texture mapping by using different examples

Model Laruana

Input texture Example 1 Example 2

Size of the input texture 183x100

Size of a tile 32x32

Number of unit cubes 2555

Number of surfaces on the polycube

4264

Number of different tiles 804 800

Time of constructing the polycube with tiles

5 min. 03 sec. 5 min. 09 sec.

Time of mapping from the polycube to the model

33 sec. 33 sec.

Figure 5.6 shows a synthesized texture by Wang tiles [4]. Figure 5.7 and 5.8 show that the results are mapped with the same input texture but different size of the unit cubes. Example 3 is our input texture and a 400x400 image. Figure 5.8 has lower distortion than Figure 5.7. But the size of

patterns in Figure 5.8 is smaller. We can not avoid some unconnected regions, as compared with Figure 5.6 (b).

Figure 5.6 (a) an input in Wang tiles (b) A synthesized texture from (a) [4]

(a) (b)

(b)

Figure 5.7 A mapping result with the texture example 3 and (b) and (c) are enlarged images

(c) (a) ( ) Example 3

(b)

(c)

Figure 5.8 A mapping result with the texture example 2 and (b) and (c) are enlarged images

(a)

Table 5.3 Information during texture mapping by using dixfferent sizes of unit cubes

Model Laruana

Input texture Example 3

Size of the input texture 400x400

Size of a tile 64x64

Number of different tiles 766 940

Time of constructing the polycube with tiles

8 min. 18 sec. 10 min. 40 sec.

Time of mapping from the polycube to the model

30 sec. 47 sec.

Another input model is a teapot, as shown in Figure 5.9(a), and an input texture is example 2. Figure 5.9(b) shows the polycube of the teapot with tiled textures. The final result is shown in Figure5.10.

(b) Figure 5.9 (a) A teapot model (b) The polycube of teapot with tiled textures

(a)

(b)

(a)

(c)

Figure 5.10 A mapping result with the texture example 2 and (b) and (c) are enlarged images

Example 4 is a 128x128 image, as shown in Figure 5.11. We apply different sizes of a tile. The final result is shown in Figure5.12. And the corresponding information about the teapot model is shown in Table 5.4.

Figure 5.11 Example 4: an input texture

Table 5.4 Information during texture mapping by using different input textures

Model Teapot

Input texture Example 2 Example 4

Size of the input texture 183x100 128x128

Size of a tile 32x32 64x64

Number of unit cubes 1425

Number of surfaces on the polycube

2568

Number of different tiles 648 679

Time of constructing the polycube with tiles

3 min. 56 sec. 8 min 35 sec.

Time of mapping from the polycube to the model

15 sec. 14 sec.

(b)

(a)

(c)

Figure 5.12 A mapping result with the texture example 4 and (b) and (c) are enlarged images

An input example with a 433x640 texture image and a Daba model are shown in Figure 5.13. Figure 5.14 shows the polycube of the model with tiled textures. And final result is shown in Figure 5.15.

(a) (b)

Figure 5.13 (a) a Daba model and (b) example 5: an input texture

Figure 5.14 The polycube of the Daba model with tiled textures

(a)

(b) (c)

Figure 5.15 A mapping result with the example 5 and (b) and (c) are enlarged images

(a)

(b) (c)

Figure 5.16 A mapping result with the example 2 and (b) and (c) are enlarged images

Figure 5.16 and 5.17 show the results with texture Example 2 and 6. The corresponding information about the Daba model is shown in Table 5.5.

(b)

(c) (d)

Figure 5.17 (a) Example 6: A 200x200 input texture (b) A mapping result with the texture example 6 and (c) and (d) are enlarged portions

(a)

Table 5.5 Information during texture mapping by using different input textures

Model Daba

Input texture Example 5 Example 2 Example6

Size of the input texture 433x640 183x100 200x200

Size of a tile 64x64 48x48 64x64

Number of unit cubes 1798

Number of surfaces on the polycube

2730

Number of different tiles 541 561 566

Time of constructing the polycube with tiles

6 min. 15 sec. 5 min 55 sec. 6 min. 13 sec.

Time of mapping from the polycube to the model

27 sec. 31 sec. 28 sec.

There are few apparent distortions in our results. These distortions are usually formed by the configurations of Type 5, Type 3 and Type 6. If we decrease the size of a unit cube, the shape of the polycube is close to the model. Then we reduce the distortions on the model. However, the size of patterns is reduced together. We can decrease the size of a tile so that the size of patterns is enlarged. However, the size of a tile is not too small because a tile should contain the complete structure of a texture.

Chapter 6

Conclusions

In this thesis, we proposed a method to map texture on 3D models automatically.

The proposed approach consists of two important processes: polycube construction and cells mapping. In the first process, we use the triangle-cube intersection algorithm [6] to construct the polycube of a model. Then we tile texture on the polycube seamlessly. Second, we process cells of the polycell separately. The textures of the cell are mappe d on the model according to its mapping direction. Therefore, users may generate texture mapping on the model by using our system easily. Table 6.1 shows the differences between our system and polycube-maps [20].

However, there are still some issues in our system.

1. Our system is not generic for some models which have a portion with large curvature, such as the ear of the bunny model.

2. In our experiment, we found that some cubes intersect only few regions of the model. The textures are compressed seriously when mapping them on these regions.

Table 6.1 Differences between two methods

Our algorithm Polycube-maps

Polycube construction Automatic

Number of unit cubes Many Few

In order to solve these problems, we reduce the size of a unit cube so that the shape of the polycube is close to the model. The distortion and the size of patterns on the model are reduced simultaneously. There is a trade-off between the distortion and the size of patterns on the model.

In the future, we will use different size of the unit cubes to construct the polycube. The shape of the polycube is similar to the model. Not all size of the square surfaces on the polycube is reduced. We can reduce the distortion and maintain the size of patterns at the same time. Another method of inverse warping can be used to reduce the distortion. We estimate the distortion of the cells before mapping on the model. The texture is warped in advance. Then we obtain the better results with the lower distortion.

Reference

[1] Alan, W., 2000. 3D computer graphics. 3rd Ed., Addison Wesley, pp.245-247

[2] Carr, N. A., AND Hart, J. C. 2002. Meshed atlases for real-time procedural solid texturing. ACM Transactions on Graphics 21, 2, 106–131.

[3] Cignoni, P., Montani, C., Rocchini, C., Scopigno, R., AND Tarini, M. 1999.

Preserving attribute values on simplified meshes by resampling detail textures. The Visual Computer 15, 10, 519–539.

[4] Cohen, M. F., Shade, J., Hiller, S., AND Deussen, O. 2003. Wang tiles for image and texture generation. ACM Transactions on Graphics 22, 3, 287–294.

[5] Culik II, K. 1996. An aperiodic set of 13 Wang tiles. Discrete Mathematics 160, 245–251.

[6] Douglas, V. 1992. Triangle-cube intersection. Graphics Gems III, pp.

236-239

[7] Efros, A., AND Freeman, W. 2001. Image quilting for texture synthesis and transfer. In Proceedings of SIGGRAPH 2001, 341–346.

[8] Efros, A., AND Leung, T. 1999. Texture synthesis by non-parametric sampling. ICCV, 1033-1038.

[9] Fu, C. W., AND Leung, M. K., 2005. Texture tiling on arbitrary topological surfaces. Proceedings of Eurographics Symposium on Rendering, 99-104, [10] Grünbaum, B., AND Shephard, G. C. 1986. Tilings and patterns. W. H.

Freeman and Company. ISSN 0716711931.

[11] Grimm, C. M. 2002. Simple manifolds for surface modeling and parameterization. In Proceedings of Shape Modeling International 2002, 237–244.

[12] Hertzmann, A., Jacobs, C., Oliver, N., Curless, B., AND Salesin, D. 2001.

Image analogies. ACM SIGGRAPH, 327-340.

[13] Lévy, B., Petitjean, S., Ray, N., AND Maillot, J. 2002. Least squares conformal maps for automatic texture atlas generation. ACM Transactions on Graphics 21, 3, 362–371.

[14] Maillot, J., Yahia, H., AND Verroust, A. 1993. Interactive texture mapping.

In Proceedings of ACM SIGGRAPH 93, 27–34.

[15] Piponi, D., AND Borshukov, G. 2000. Seamless texture mapping of subdivision surfaces by model pelting and texture blending. In Proceedings of ACM SIGGRAPH 2000, 471–478.

[16] Sander, P., Wood, Z., Gortler, S. J., Snyner, J., AND Hoppe H. 2003.

Multi-chart geometry images. In Proc. of the Symposium on Geometry Processing 2003, 146–155.

[17] Sheffer, A., AND Hart, J. C. 2002. Seamster: inconspicuous low distortion texture seam layout. In Proceedings of Visualization 2002, 291–298.

[18] Sorkine, O., Cohen-or, D., Goldenthal, R., AND Lischinski, D. 2002.

Bounded-distortion piecewise mesh parameterization. In Proceedings of Visualization 2002, 355–362.

[19] Stam, J., 1997. Aperiodic texture mapping. Tech. rep., R046. European Research Consortium for Informatics and Mathematics (ERCIM).

http://www.ercim.org/publication/technical reports/046-abstract.html.

[20] Tarini M., Hormann K., Cignoni P., Montani C., 2004. Polycube-maps. In Proceedings of SIGGRAPH 2004, 853–860.

[21] Kwatra, V., Schodl, A., Essa, I., Turk, G., AND Bobicks, A. 2003.

Graphcut textures: image and video synthesis using graph cuts. In Proceedings of ACM SIGGRAPH , pp.277-286.

[22] Wang, H. 1965. Games, logic, and computers. Scientific American (November), 98–106.

[23] Wang, H. 1961. Proving theorems by pattern recognition ii. Bell Systems Technical Journal 40, 1–42.

[24] Wei, L. Y., AND Levoy, M. 2000. Fast texture synthesis using tree-structured vector quantization. ACM SIGGRAPH, 479-488.

相關文件