360 likes | 620 Views
Simulating Decorative Mosaics. Alejo Hausner University of Toronto. Mosaic Tile Simulation. Reproduce mosaic tiles long-lasting (graphics is ephemeral) realism with very few pixels pixels have orientation. Real Tile Mosaics. Real Mosaics II. The Problem.
E N D
Simulating Decorative Mosaics Alejo Hausner University of Toronto
Mosaic Tile Simulation • Reproduce mosaic tiles • long-lasting (graphics is ephemeral) • realism with very few pixels • pixels have orientation Simulating Decorative Mosaics
Real Tile Mosaics Simulating Decorative Mosaics
Real Mosaics II Simulating Decorative Mosaics
The Problem • Square tiles cover the plane perfectly • Variable orientation --> loose packing • Opposing goals: • non-uniform grid • dense packing Simulating Decorative Mosaics
Previous Work • Romans: algorithm? • Relaxation (Haeberli’90) • scatter points on image • voronoi region = tile • tiles not square Simulating Decorative Mosaics
Previous Work • Escherization (Kaplan’00) • regular tilings • use symmetry groups • Stippling (Deussen’01) • voronoi relaxation • round dots Simulating Decorative Mosaics
Voronoi Diagrams • What are they • sites, and regions closest to each site • How to compute them? • Divide & conquer (PS) • sweepline (Fortune) • incremental Simulating Decorative Mosaics
Voronoi Diagram Simulating Decorative Mosaics
Centroidal Voronoi Diagrams • VD sites are not centroids • Lloyd’s method (k-means) • move site to centroid, • recalculate VD • repeat Simulating Decorative Mosaics
Centroidal Voronoi Diagrams • VD sites are not centroids • Lloyd’s method (k-means) • move site to centroid, • recalculate VD • repeat Simulating Decorative Mosaics
Centroidal Voronoi Diagrams • VD sites are not centroids • Lloyd’s method (k-means) • move site to centroid, • recalculate VD • repeat Simulating Decorative Mosaics
Centroidal Voronoi Diagram Simulating Decorative Mosaics
CVD uses • Nature: • honeycombs • giraffe spots • Sampling • approximates Poisson-disk (low discrepancy) • can bias for filter function Simulating Decorative Mosaics
Hardware-assisted VD’s • SG99: Hoff et al • uses graphics hardware • draw cone at each site • orthogonal view from above • each region is single-coloured • can extend to non-point sites (curves) project Simulating Decorative Mosaics
Key idea r • Cone is distance function • radius = height • Non-euclidean distance: • different kind of cone • eg square pyramid • can be non-isotropic (rotate pyramid around Z) h (a,b) h (x,y) h=|x-a|+|y-b| Simulating Decorative Mosaics
Basic Tiling Algorithm • Compute orientation field (details later) • scatter points on image • use pyramids to get oriented tiles • apply Lloyd’s method to spread sites evenly • draw oriented tile at each site Simulating Decorative Mosaics
Details • Lloyd’s method: • To compute centroid of each Voronoi region: 1: read back pixels, 2: get average (row,col) per colour 3: convert back to object coords. Simulating Decorative Mosaics
Lloyd Near Convergence Simulating Decorative Mosaics
Orientation Field • Choose edges that need emphasis • compute generalized VD for edges (Hoff99) • get gradient vector of distance field • distance = z-buffer distance • gradient orientation = tile orientation • points away from edges Simulating Decorative Mosaics
Orientation Field Simulating Decorative Mosaics
Edge Discrimination • Must line up tiles on edges • But both sides of edge oriented same • square tiles ==> 180o rotational symmetry • Use hardware • draw edge thick, different colour • voronoi regions move away from edges • leaves gap where edge is. Simulating Decorative Mosaics
Tiles Straddle Edge Simulating Decorative Mosaics
Thick Edge: Centroid Repelled Simulating Decorative Mosaics
After 10 Iterations Simulating Decorative Mosaics
Original Voronoi Diagram Simulating Decorative Mosaics
After 20 Iterations Simulating Decorative Mosaics
One Tile per Voronoi Region Simulating Decorative Mosaics
Thinner Tiles Simulating Decorative Mosaics
Round Tiles Simulating Decorative Mosaics
Rhomboidal Tiles Simulating Decorative Mosaics
Tiles are not Pixels 4000 tiles 4000 pixels Simulating Decorative Mosaics
More Pictures Simulating Decorative Mosaics
“Painterly” Rendering Tile = Paint stroke Simulating Decorative Mosaics
Summary • New method for packing squares on curvilinear grid • Minimizes sum of particle distances Simulating Decorative Mosaics
Further Work • Reduce “grout” • final pass: adjust tile shapes • currently don’t use adjacency info • use divergence of orientation field · • Improve colour • real tiles have fixed colour set: Dither? How? Simulating Decorative Mosaics