Download presentation
Presentation is loading. Please wait.
Published byGideon Cathell Modified over 10 years ago
1
Simulating Decorative Mosaics Alejo Hausner University of Toronto [SIGGRAPH2001]
2
Decorative Mosaics SIGGRAPH 2001 2 Mosaic Tile Simulation Reproduce mosaic tilings –long-lasting (graphics is ephemeral) –realism with very few pixels –pixels have orientation
3
Decorative Mosaics SIGGRAPH 2001 3 Real Tile Mosaics
4
Decorative Mosaics SIGGRAPH 2001 4 Real Mosaics II
5
Decorative Mosaics SIGGRAPH 2001 5 The Problem Square tiles cover the plane perfectly Variable orientation loose packing Opposing goals: –non-uniform grid –dense packing
6
Decorative Mosaics SIGGRAPH 2001 6 Formal Statement Given a rectangular region I 2 in the plane R 2, and a vector field (x, y) defined on that region, find N sites P i (x i, y i ) in I 2 and place N squares of side s, one at each P i, oriented with sides approximately parallel to (x i, y i ), such that all squares are disjoint and the area they cover is maximized.
7
Decorative Mosaics SIGGRAPH 2001 7 Previous Work Romans: algorithm? Relaxation (Haeberli 90) –scatter points on image –voronoi region = tile –tiles not square
8
Decorative Mosaics SIGGRAPH 2001 8 Previous Work Escherization (Kaplan 00) –regular tilings –use symmetry groups Stippling (Deussen 01) –voronoi relaxation –round dots
9
Decorative Mosaics SIGGRAPH 2001 9 Voronoi Diagram What is it? –Input: sites (generators) –Result: regions closest to each site
10
Decorative Mosaics SIGGRAPH 2001 10 Voronoi Diagram
11
Decorative Mosaics SIGGRAPH 2001 11 Centroidal Voronoi Diagrams VD sites centroids Lloyds alg. (k-means): –1: move site to centroid –2: recalculate VD –3: repeat
12
Decorative Mosaics SIGGRAPH 2001 12 Centroidal Voronoi Diagrams VD sites centroids Lloyds alg. (k-means): –1: move site to centroid –2: recalculate VD –3: repeat
13
Decorative Mosaics SIGGRAPH 2001 13 Centroidal Voronoi Diagrams VD sites centroids Lloyds alg. (k-means): –1: move site to centroid –2: recalculate VD –3: repeat
14
Decorative Mosaics SIGGRAPH 2001 14 CVD After Convergence Almost a hexagonal grid
15
Decorative Mosaics SIGGRAPH 2001 15 CVD properties Minimum-energy arrangements In Nature: –honeycombs –giraffe spots Point Sampling: –approximates Poisson-disk (low discrepancy) –can bias for filter function
16
Decorative Mosaics SIGGRAPH 2001 16 Key Idea 1 CVDs and Tilings –best circle packing = hexagonal tiling –Euclidean metric: CVD =hexagonal tiling –different metric: CVD = ? Mosaics are Tilings –non-periodic –locally-varying orientation
17
Decorative Mosaics SIGGRAPH 2001 17 Key Idea 1 (continued) Create mosaic metric –locally Manhattan (L 1 ) –locally varying orientation BUT: –existing algorithms limited –they assume Euclidean metric –if L 1 metric: they assume isotropic
18
Decorative Mosaics SIGGRAPH 2001 18 Hardware-assisted VDs Hoff 99 –uses graphics hardware –draw cone at each site –orthogonal view from above –region color = cone color –can extend to non-point sites (curves) project
19
Decorative Mosaics SIGGRAPH 2001 19 Key idea 2 Cone is distance function –radius = height Non-euclidean distance: –different kind of cone –eg square pyramid –can be non-isotropic (rotate pyramid on Z axis) r h h=|x-a|+|y-b| (a,b) (x,y) h h 2 =(x-a) 2 +(y-b) 2 (a,b) (x,y)
20
Decorative Mosaics SIGGRAPH 2001 20 Basic Tiling Algorithm Compute orientation field (details later) initialize: random points on image –use pyramids to get oriented tiles use Lloyds method –spreads sites evenly draw oriented tile at each site
21
Decorative Mosaics SIGGRAPH 2001 21 Details Lloyds method: –to get Voronoi region centroids: 1: read back pixels (frame buffer) 2: get average (row,col) per colour 3: convert back to object coords. –move sites to centroids –repeat until converged
22
Decorative Mosaics SIGGRAPH 2001 22 Algorithm 1.S<-list of random points on the image. 2.repeat until converged: a.for each p in S, place a square pyramid with apex at p. b.rotate each pyramid about the z axis to align it with the direction field (p). c.render the pyramids with an orthogonal projection onto the xy plane, producing a voronoi diagram. d.compute the centroid of each voronoi region. e.move each p to the centroid of its voronoi region. 3.draw a tile centred at each p, oriented along.
23
Decorative Mosaics SIGGRAPH 2001 23 Lloyd Near Convergence Manhattan metric (isotropic)
24
Decorative Mosaics SIGGRAPH 2001 24 Tile Orientations Artisans algorithm –draw region boundaries –line tiles up on boundaries –build concentric rows Tile orientations –emphasize boundary curves –near curve: must follow curve –far from curve: dont care
25
Decorative Mosaics SIGGRAPH 2001 25 Orientation Field Vector Field – (x,y) unit vector at each (x,y) –near a curve: = curve direction –far away: less curve influence Align tiles to –rotate Manhattan-metric pyramids –rotate square tiles
26
Decorative Mosaics SIGGRAPH 2001 26 Computing (x,y) Choose curves that need emphasis get VD for curves (Hoff 99) –draw generalized cones z(x,y) = eye distance = z-buffer(x,y) –z = distance from curve get gradient, normalize – (x,y) = z | z|
27
Decorative Mosaics SIGGRAPH 2001 27 Generalized Cones
28
Decorative Mosaics SIGGRAPH 2001 28 Edge Discrimination Problem: Tiles on Curve – same on both sides (mod 180 o ) –rotate tile 180 o no change –Lloyds alg. ignores edges –result: tiles straddle curves
29
Decorative Mosaics SIGGRAPH 2001 29 Edge Discrimination Solution: use hardware –draw edge thick, different color –edge overwrites part of tile –centroids move away from edge –apply Lloyds alg. –leaves gap where edge was.
30
Decorative Mosaics SIGGRAPH 2001 30 Edge Discrimination –Tiles on edge –new centroids –move sites –repeat Lloyds –gap created –repeat Lloyds –edge is clear
31
Decorative Mosaics SIGGRAPH 2001 31 Edge Discrimination –Tiles on edge –new centroids –move sites –repeat Lloyds –gap created –repeat Lloyds –edge is clear
32
Decorative Mosaics SIGGRAPH 2001 32 Edge Discrimination –Tiles on edge –new centroids –move sites –repeat Lloyds –gap created –repeat Lloyds –edge is clear
33
Decorative Mosaics SIGGRAPH 2001 33 Edge Discrimination –Tiles on edge –new centroids –move sites –repeat Lloyds –gap created –repeat Lloyds –edge is clear
34
Decorative Mosaics SIGGRAPH 2001 34 Edge Discrimination –Tiles on edge –new centroids –move sites –repeat Lloyds –gap created –repeat Lloyds –edge is clear
35
Decorative Mosaics SIGGRAPH 2001 35 Edge Discrimination –Tiles on edge –new centroids –move sites –repeat Lloyds –gap created –repeat Lloyds –edge is clear
36
Decorative Mosaics SIGGRAPH 2001 36 Edge Discrimination –Tiles on edge –new centroids –move sites –repeat Lloyds –gap created –repeat Lloyds –edge is clear
37
Decorative Mosaics SIGGRAPH 2001 37 Putting It All Together
38
Initial random tiles
39
Putting It All Together 20 iterations of Lloyds
40
Putting It All Together Edges cleared
41
Putting It All Together Final tiling
42
Decorative Mosaics SIGGRAPH 2001 42 Tile Attributes We have: –tile position, orientation Can also control: –size –aspect ratio –shape (round, square, diamond) –colour
43
Decorative Mosaics SIGGRAPH 2001 43 Colour Each tile colour –the tiles centre point –average over all pixels Point samples work best for images with uniformly-coloured regions Area samples suit continuous-tone images
44
Decorative Mosaics SIGGRAPH 2001 44 Size h*w pixel image with n tiles, this yields tiles with sides of d = pixels. – < 1 accounts for packing inefficiencies due to variations in Smaller tiles for detail area z= (|x-x 0 |+|y-y 0 |)
45
Decorative Mosaics SIGGRAPH 2001 45 Size Initial tile positions? –uniform slow convergence –rejection sampling An initial tile position will be accepted with probability (s min /s) 2 –s = tile size –s min = smallest tile size in the image
46
Decorative Mosaics SIGGRAPH 2001 46 Aspect Ratio Fine detail is needed when –near a curve –any places where the direction field must be strongly emphasized z= |x-x 0 |+(1- )|y-y 0 |
47
Lybian Sibyl Original Curves, regions, (x,y)
48
Size Variation 2000 equal-size tiles 2000 variable-size tiles
49
Tiles Carry More Information 2000 PIXELS 2000 TILES
50
50 Other Effects: Painterly Oval over-size overlapping tiles
51
51 Other Effects: Regions Voronoi regions with color from image
52
52 More Pictures Second Story Sunlight (Hopper 60)
53
53 More Pictures Stained-glass photograph
54
54 More Pictures Photograph: Seal on Beach
55
Decorative Mosaics SIGGRAPH 2001 55 Summary Pack tiles on curvilinear grid –Low-energy particle arrangements Generalized CVD –Voronoi diagram for any metric –Use graphics hardware
56
Decorative Mosaics SIGGRAPH 2001 56 Further Work Reduce grout –final pass: adjust tile shapes currently dont use adjacency info Paint strokes –textured tiles
57
Decorative Mosaics SIGGRAPH 2001 57 Further Work User-defined –better tile orientations Tile shapes –higher moments: x 2, xy, etc. Dithering –no regular grid
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.