0% found this document useful (0 votes)
79 views

Computer Graphics 2 - Object Representations: Tom Thorne

This document discusses various methods for representing 3D polygon meshes in computer graphics, including: - Storing mesh data by listing vertex positions and indices for triangles or quads - Representations like triangle strips that reduce storage requirements - Generating meshes from 3D models, scanning, or procedural rules - Using implicit surfaces defined by potential functions to model smooth surfaces - Level of detail scaling methods like progressive meshes to reduce polygon count for distant objects It also covers standard image representations like pixel buffers, alpha channels, and z-buffers.

Uploaded by

JuhiRai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Computer Graphics 2 - Object Representations: Tom Thorne

This document discusses various methods for representing 3D polygon meshes in computer graphics, including: - Storing mesh data by listing vertex positions and indices for triangles or quads - Representations like triangle strips that reduce storage requirements - Generating meshes from 3D models, scanning, or procedural rules - Using implicit surfaces defined by potential functions to model smooth surfaces - Level of detail scaling methods like progressive meshes to reduce polygon count for distant objects It also covers standard image representations like pixel buffers, alpha channels, and z-buffers.

Uploaded by

JuhiRai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Computer Graphics 2 - Object representations

Tom Thorne

Some slides are courtesy of Taku Komura


[email protected]
www.inf.ed.ac.uk/teaching/courses/cg/

Last time

I
I
I

History, applications
Basic vector algebra
Computer graphics pipeline

Overview
Polygon meshes
I
I
I
I
I
I

Storage
Representation
Decomposition
Quad meshes
Generation
Implicit surfaces

Level of detail
I

Scaling methods

Image representations
I
I
I

Pixel Buffers
Alpha channels
Z buffers

Mesh structures

Objects represented as a set of polygons

Triangle representation

Polygons can be broken down into triangles

Mesh topology
Manifolds:
I
I

All edges belong to two triangles


All vertices have a single continuous set of triangles around
them

Mesh topology
Manifolds with boundaries:
I
I

All edges belong to one or two triangles


All vertices have a single continuous set of triangles around
them

Mesh topology
Examples of non-manifold meshes:

Storage format

Vertices:
-1 1
-1 -1
1 -1
1 1
-1 1
-1 -1
1 -1
1 1

1
1
1
1
-1
-1
-1
-1

Polygons:
1 2 3
1 3 4
1 4 8
1 8 5
4 3 8
3 7 8
5 7 6
5 8 7
1 5 2
5 6 2
2 6 7
2 7 3

4
6

Orientation

Vertexes in triangle list stored in counter clockwise order

Triangle fans

Instead of storing 3T edges, store T + 2

Triangle strips

Instead of storing 3T edges, store T + 2

Decomposing surfaces

We can decompose meshes into triangle strips or fans to reduce


storage requirements
Some methods:
I
I

Minimal spanning tree


Sprials

Minimal spanning tree decomposition


A minimal spanning tree produces a tree over a graph which visits
every node whilst minimising costs
I
I

edges are given costs


a tree with minimal total cost is found

Minimal spanning tree decomposition


From a mesh, produce a graph where:
I
I
I

nodes correspond to triangles of the mesh


edges shared by a pair of triangles become edges in the graph
cost is set to the Euclidean distance between the triangle and
the root triangle
Geometric Compression

89
Geometric Compression

89

Sprial decomposition
Geometric Compression

I
I

91

Generate layers of triangles


Connect layers into a single
spiral of triangles
98

G. Taubin and J. Rossignac

Fig. 3. Two ways of peeling an orange: (a) (b) the thick edges are the edges of the vertex tree
constructed on the mesh; (c) (d) the mesh is cut through the vertex tree edges (the vertex
positions have been modified here only to illustrate the creation of the cut); (e) (f) the result is
a topological simply connected polygon. The dual graph of this polygon is the triangle tree.

boundary. A single bit of information per marching edge is used to encode


the correct side. These bits are concatenated in the order in which the
corresponding marching edges are visited by the decompression algorithm.
They form what we call a marching pattern of left or right steps.
An entry of our representation of the triangle spanning tree indicates the
number N of marching edges in a run and thus the total number of vertices
on both sides of the triangle run. The number of zeros in the corresponding
subset of the marching pattern indicates the number of vertices on the left
Fig. 5. Compression algorithm: (a) triangular mesh; (b) topological distance from a chosen
side (the number of ones indicates the number of vertices on the right side).
vertex defines the layers; (c) vertex tree and triangle
tree
are constructed
bytable
traversing
the
Given two
indices
into the lookup
for the bounding
loop (one for the
layers in order; (d) polygon resulting fromstarting
cutting
along
with
artificial
point
of thecut
left edges
boundary
of the
triangle gap
run and one for the startintroduced. Triangles are color coded according
their
corresponding
layer.
ingto
point
of the
right boundary),
our decompression algorithm uses the next
N ! 1 bits of the marching pattern and constructs a triangle strip for the
run.

Directed edge data structure

neighbour

Vertices
x1 y1
x2 y2
..
..
.
.

z1
z2
..
.

Edges
va vb
..
..
.
.

eneighbour
..
.

next

er
es
..
.
enext
..
.

eprev
..
.

prev

Surface normals
Calculation:

n = (t r ) (s r )

r
uv

s
v=t-r
u=s-r

Surface normals
Face normals

Surface normals
Vertex normals

Quadrilateral meshes
Relatively easy to extend to quadrilateral meshes (quadmeshes):
I

Same storage format

Problems:
I

4 points dont always lie on a plane

Quadrilateral meshes
Benefits of quadmeshes:
I

Easier to align edges to curvature or feature lines defining an


object

Lvy,/ Quad
N. Pietroni,
E. Puppo, C. Silva, M. Tarini,
D. Bommes, B. Lvy, N. Pietroni, E. Puppo, C. Silva, D.
M.Bommes,
Tarini, D.B.
Zorin
Meshing
9 D. Zorin / Qua

(a)

(b)

(a)

(c)

(b)

(d)

(c)

Figure 7: Prototype of a field guided method:


Given7: anPrototype
input triangle
(a) in the
first step
an orientation
field (b)
is (a) in the fir
Figure
of a mesh
field guided
method:
Given
an input triangle
mesh
computed which represents the local rotationcomputed
of quad elements.
In the second
step rotation
a sizing of
field
(c) elements.
is determined
which
which represents
the local
quad
In the
second step a sizin
specifies the sample density, which in this example
is isotropic
anddensity,
close to which
uniform,
withexample
slight deviations
color
coded
specifies
the sample
in this
is isotropic
and
closefrom
to uniform, with sl

Quadrilateral meshes

I
I
I

Easier to texture map


Good for finite element simulation
Easier to fit with parametric surfaces

Generating polygon mesh data

I
I
I
I

Where does the mesh come from?


Modelling using software (e.g. Blender)
Scanning
Procedural methods

Scanning meshes
Laser range scanning
I
I

Measuring time for a laser beam to bounce back from surface


Produces accurate data

Stereo vision
I

Two cameras, estimate depth

KINECT
I
I

Estimating depth from infra-red light


Limits on range (1.2-3.5m)

Procedural models
I

Rule based approaches

Implicit surfaces
Given some potential function f (x ) we can evaluate at every point
in space, define an isosurface of all points where f (x ) = c
I

Metaballs (Blinn, Ohmura)

P ai
i r

Marching cubes
Potential is computed at each point on a grid
I
I

where edges of the grid cross the threshold, the surface is


produced
set of rules for producing the surface based on which edges
cross the threshold

Overview
Polygon meshes
I
I
I
I
I
I

Storage
Representation
Decomposition
Quad meshes
Generation
Implicit surfaces

Level of detail
I

Scaling methods

Image representations
I
I
I

Pixel Buffers
Alpha channels
Z buffers

Level of detail scaling

When an object is close to the camera we usually want a very


detailed model. But not when:
I
I
I

further away (taking up a small amount of space on screen)


facing away from the camera
outside the view volume

Level of detail scaling


Progressive meshes
I

some polygons may be much closer to camera than others,


within
aM (1single
mesh
(a) Base14:
mesh
face) refinement
(b) M ( (1,000
(10,000
(d) M =faces
M (79,202
Figure
View-dependent
= 0 15 faces)
; 1,782 faces) of(c)
aM
truncated
PM faces)
representation (10,000
in M) faces)
created from a
0

514

5066

tessellated
(25,440 faces).
Interactive
frame
rate near this
viewpoint
is 14.7 frames/sec,LOD
versus
6.8 frames/sec
Figure parametric
11: The PMsurface
representation
of a mesh
M captures
a continuous
sequence
of view-independent
meshes
M0
M n using
= M. M.

(a) Top
Original
(b) View 1 (3,157 faces)
(a)
viewM
( (42,712
= 0 0 ; faces)
33,119 faces)
(b) Top and regular views (c)
( =View
0 33 2 ;(2,559
10,013faces)
faces)
Figure 15: Two view-dependent refinements of a general mesh M using view frustums highlighted in orange and with

set to 0.6%.

(c) Texture mapped M (79,202 faces)


(d) Texture mapped (10,013 faces)
(e) 764 generalized triangle strips
Figure
12: View-dependent
refinement of the same PM, using the
frustum
(highlighted
in orange)
a screen-space
(a) Original
M (69,473 faces)
(b)view
Front
view and
(c) Top view
( = 0 1and; 10,528
faces) geometric error

Level of detail scaling


Progressive meshes

vsplit

f n1
f n0

vs

fn1 v f n3
u

fn3

fl

f n2

fr

fn0 v t f
n2
ecol

Figure 2: New definitions of vsplit and ecol.

3 SELECTIVE REFINEMENT FRAMEWORK

Overview
Polygon meshes
I
I
I
I
I
I

Storage
Representation
Decomposition
Quad meshes
Generation
Implicit surfaces

Level of detail
I

Scaling methods

Image representations
I
I
I

Pixel Buffers
Alpha channels
Z buffers

Image representations
Standard 32 bit format for colours:

A R G B
31 - 24 23 - 16

15 - 8

7-0

Other formats:
I
I

32bit Floats per channel (high dynamic range)


24bit RGB (usually padded)

Pixel buffers

0 1 2 3
0
1
2
3

int array[4][4];
int arrayFlat[16];
array[y][x]=arrayFlat[y*width+x];

Z buffers

How do we make sure things closer to the camera are drawn on


top of things behind?
I
I
I

various methods covered later in the course


current most popular method is the Z buffer
implemented by GPU, very little work to use with OpenGL

Summary
Polygon meshes
I
I
I

How to store them


Data structures for operations on meshes
Creating mesh data

Level of detail
I
I

Why?
Scaling

Image data
I
I
I

Standard storage format


Alpha channels
Z buffers

References
Shirley:
I
I

Chapter 12.1 (Data Structures for Graphics Triangle


Meshes)
Chapter 3 (Raster Images)

Papers:
I

I
I

Taubin, G., & Rossignac, J. (1998). Geometric compression


through topological surgery. ACM Transactions on Graphics,
17(2), 84115.
D. Bommes, B. Lvy, N. Pietroni, E. Puppo, C. Silva, M.
Tarini and D. Zorin, Eurographics STARS, 2012
Hoppe, H. (1997). View-dependent refinement of progressive
meshes (pp. 189198). SIGGRAPH 97

You might also like