shape representation 1 - PowerPoint PPT Presentation

1 / 82
About This Presentation
Title:

shape representation 1

Description:

Source: http://www.3d-station.com/pages/tutorials/tutorial.php?id=131&page=1 ... Individually coloring each polygon would be tedious ... – PowerPoint PPT presentation

Number of Views:68
Avg rating:3.0/5.0
Slides: 83
Provided by: ianhor2
Category:

less

Transcript and Presenter's Notes

Title: shape representation 1


1
shape representation 1
  • polygons and polyhedra

2
How do we represent the shape of an object?
3
Eeeew
  • We dont really need to represent all the details
    of an object
  • Just approximate the shape
  • Enough that it looks right when displayed

4
What do we mean by shape?
5
The interior of the shape?
6
The boundary of the shape?
7
Representation of shape
  • In computer graphics, we usually use boundaries
  • Curves in 2D
  • Surfaces in 3D
  • A curve or surface is an (infinite) set of points
  • This is a problem, since our computers dont have
    infinite memory

8
Approximating a curve
9
Linear approximation
We can use a line as a (bad) approximation to a
curve
10
Piecewise-linear approximation
We can use several lines to make a better
approximation
11
Approximating a curve
By adding more lines, we can make it as accurate
as we like
12
Approximating a curve
By adding more lines, we can make it as accurate
as we like
13
Polylines
We end up with a bunch of line segments that
share endpoints
14
Vertices and edges
The endpoints are called vertices and the line
segments edges
15
Vertices and edges
We can change the shape by moving a vertex
16
Closed curves and polygons
If the curve joins up with itself, we say its a
closed curve
17
Closed curves and polygons
A closed curve made out of lines is called a
polygon
18
Concave polygons
concavity
A polygon with an indentation is called a concave
polygon
19
Convex polygons
A polygon with no concavities is called convex
20
Representing surfaces
  • To represent 3D objects, we need to represent
    their surfaces

Source http//www.d-vw.com/news/advanced/active_l
ighting.htm
21
Planar approximation
  • We approximated 2D shapes with groups of line
    segments(aka polygons)
  • What would the 3D equivalent be?
  • The 3D analog of a line is a plane
  • So we approximate surfaces with groups of planar
    patches
  • What would those patches look like?

22
Planar approximation
  • What would those patches look like?
  • Planes intersect in lines
  • So many planes intersect in many lines
  • Gee, this sounds familiar

23
Polygonal approximation
  • Whenever 4 or more planar patches intersect, they
    form a polygon
  • Shapes modeled with planar patches form groups of
    polygons

24
Vertices, edges, and faces
  • In 3D
  • The corners of the polygons are still called
    vertices
  • But the lines between them are called edges
  • And the polygons themselves are called faces
  • Every edge is part of two faces
  • Every vertex is part of at least two lines

vertices
25
Vertices, edges, and faces
  • In 3D
  • The corners of the polygons are still called
    vertices
  • But the lines between them are called edges
  • And the polygons themselves are called faces
  • Every edge is part of two faces
  • Every vertex is part of at least two lines

edges
26
Vertices, edges, and faces
  • In 3D
  • The corners of the polygons are still called
    vertices
  • But the lines between them are called edges
  • And the polygons themselves are called faces
  • Every edge is part of two faces
  • Every vertex is part of at least two lines

faces
27
Polygonal meshes
  • When large groups of polygons form a surface, we
    call it a mesh
  • Meshes polygons share a common set of vertices
  • Polygon meshes are the (current) standard
    technology for surface modeling

Source http//www.d-vw.com/news/advanced/active_l
ighting.htm
28
Polygonal meshes
29
Meshes have a long tradition
Perspective Study of a Chalice Paolo Uccelloin
1430-1440.
30
Triangle meshes
  • 3D modeling programs usually represent surfaces
    as arbitrary polygons
  • Most graphics cards
  • Provide hardware for drawing triangles
  • Draw other polygons by making them out of
    multiple triangles
  • Polygon meshes are usually converted to triangle
    meshes for final rendering
  • So many artists model directly using the triangle
    mesh so they have as much control as possible

31
Resolution and polygon count
  • Graphics card speed is often measured in
    triangles per second
  • A 1M tri/sec card can render
  • A 10,000 triangle scene at 100fps
  • A 100,000 triangle scene at 10 fps
  • So models trade off speed for accuracy
  • More polys more realistic still frames
  • More polys less realistic animation
  • Many artists in the game industry specialize in
    low poly count modeling

Source http//cache-www.intel.com/cd/00/00/01/45/
14535_continuous_detail_levels_f2.jpg
32
10000 triangles
Source http//www.cs.utah.edu/wyman/classes/wave
lets/proj4/
33
9000 triangles
34
8000 triangles
35
7000 triangles
36
6000 triangles
37
4000 triangles
38
3000 triangles
39
Polygon modeling techniques
  • 3D Scanning
  • Sorry, we cant do that
  • Make a primitive shape
  • Most modelers can make spheres, cones, cubes,
    etc. automatically
  • Deform an existing shape
  • Rotate, translate, scale
  • Stretch (scale in one direction)
  • Move the vertices around
  • Add/remove vertices(Modeling tool will
    split/merge polygons accordingly)

40
Solids of revolution
  • Solids of revolution are common in the real world
  • Lathes are machines specifically design to
    manufacture them

41
Turning an object on a lathe
42
An electronic latheMaking a wine glass in Maya
  • Start by drawing the curve for the profile of the
    object

Source http//www.3dvf.com/modules/publish/Articl
es-Dossiers_1429_2.html
43
Making a wine glass
  • Start by drawing the curve for the profile of the
    object
  • Select the revolve operation

Source http//www.3dvf.com/modules/publish/Articl
es-Dossiers_1429_2.html
44
Making a wine glass
  • Start by drawing the curve for the profile of the
    object
  • Select the revolve operation
  • Voila!

Source http//www.3dvf.com/modules/publish/Articl
es-Dossiers_1429_2.html
45
Extruding an existing face
  • Most modelers will let you pull a face out from
    the surface
  • It will automatically create new polygons to
    rejoin the face to the surface

Source http//www.3d-station.com/pages/tutorials/
tutorial.php?id131page1
46
Extruding an existing face
  • Most modelers will let you pull a face out from
    the surface
  • It will automatically create new polygons to
    rejoin the face to the surface

47
Extruding an existing face
48
Example Making a T-Shirt
  • Start with a cube

Source http//zobal.free.fr/tuts/acm/en_acm2.htm
49
Face extrusion
  • Extrude the top face

50
Face extrusion
  • Pull the sides in to make the neck
  • Do the same thing to make the arm

51
Face deletion
  • Right now, the arm is closed at the end
  • Remove the face on the end to make an arm hole

52
Removing one side
  • Remove
  • All the faces on the left side
  • The bottom face
  • And generally tweak the vertices until you like
    them

53
Forming the whole thing
  • Now clone the mesh
  • Flip it over
  • And join it to the old mesh

54
Smoothing
  • Most modeling tools have a smoothing function
  • Warning this increases the number of polygons
    dramatically!
  • After smoothing, tweak to taste

55
Rendering
  • The previous images were wireframes
  • The just show the vertices and edges
  • Rendering is the process of producing a final
    image from the polygon mesh

56
Surface reflection
incident ray
  • Surface reflectance is very complicated
  • There are two main models of reflectance
  • Specular (glossy) surfaces bounce it directly off
  • Lambertian (matte) bounce it evenly in all
    directions

reflected rays
specular reflection (highlights)
incident ray
reflected rays
Lambertian reflection (matte/diffuse)
57
Specular reflection
  • Mirror-like reflection
  • Mirrors are near-perfect specular reflectors
  • Incident and reflected rays have at (almost) the
    same angle
  • In practice, theres some scattering
  • All wavelengths are (usually) reflected equally
  • So reflection has the color of the light

incident ray
reflected rays
58
Lambertian reflection
  • Lambertian/diffuse/matte reflection
  • Perfect non-glossy paint
  • Light reflected equally in all directions
  • Brightness depends on illumination angle
  • When light hits and an angle, its spread out
    over a wider area (1/sin ? times wider)
  • So the intensity of the light coming out is
    dimmed by sin ?
  • Not all wavelengths are reflected equally
  • The reflection has the color of the surface (at
    least if the light is white)

?
d
?
d/sin ?
beam spreads out by 1/sin ?
59
Surface normals
  • (For reasons that will be clearer later)
  • We usually measure the angle a little differently
  • We use the angle between the light and
  • A line sticking straight out from the surface
  • This is called the surfaces normal
  • This means the dimming factor is cos ?
  • Because we measured ? differently

surface normal
?
d
?
d/cos ?
beam spreads out by 1/cos ?
60
Specular and diffuse reflection
61
Normals in 3D
  • Each point on a surface has a normal
  • Vector that sticks out perpendicularly to the
    surface
  • For polygonal models, all points in a polygon
    have the same normal
  • Although rendering sometimes uses fake normals
    to generate a better appearance

62
Flat shading
  • Since all points on a face have the same normal
  • So they really look flat
  • And the boundaries are very noticeable

Source http//www.cgl.uwaterloo.ca/mmwasile/cs68
8/project.html
63
Normal interpolation
  • By interpolating the normals, we get a much
    smoother look without using more polys
  • Each pixel in a face recalculates its normal
  • Using an average of the normals of each vertex
  • Weighted by distance from the vertex
  • Closer vertices exert more influence

64
Phong shading
  • Phong shading is a common lighting model based on
  • Specular and diffuse components
  • With normal interpolation
  • Ambient component
  • Added evenly to all pixels
  • Acts like a fill light

65
Phong shading
Source wikipedia
66
Whats in a model?
  • Geometry
  • All the vertices of the mesh
  • Connectivity information (which vertices form
    which edges/faces)
  • Material information
  • Diffuse color
  • Specular color
  • Specular hardness
  • Ambient color
  • Different polys can have different materials
  • Each polygon can only have one material

67
Texture mapping
  • Individually coloring each polygon would be
    tedious
  • It would also take a lot of triangles to make a
    realistic object

Source http//escience.anu.edu.au/lecture/cg/Text
ureJ3D/printNotes.en.html
68
Texture mapping
  • Graphics hardware has the ability to paint faces
    with sections of a bitmap image
  • Called textures
  • Vertices are tagged with texture coordinates
  • Specify a pixel within the texture
  • Pixels in the interior of the face are painted
    with the pixels between the pixels of the
    vertices
  • Texture is often used to make objects look more
    complicated than they really are
  • There are no actual depressions between the
    bricks in this image

Source http//escience.anu.edu.au/lecture/cg/Text
ureJ3D/printNotes.en.html
69
The curse of topology
  • Texture maps are flat
  • Most 3D objects arent
  • To map a flat texture to a curved 3D object we
    have to
  • Stretch some parts
  • Squish others
  • Cut holds (sometimes)

Source http//ligwww.epfl.ch/silic/predocschool/
Project/projectreport.htm
70
Mesh
Source http//www.randomstuff.org.uk/laura/Galle
ry_digital_art/silenus.html
71
Texture maps
72
Mapped mesh
73
With and without texture
74
Normal mapping
  • Normal mapping is another way to make a low poly
    model look like a high poly model
  • Provide a texture map for normals
  • Lets the artist paint changing normals over a
    single poly
  • Normals respond to lighting as if they were part
    of the real geometry
  • Q Why wouldnt we just paint dark and bright
    regions on a normal texture map?

75
famous examples over the ages
76
The death star trench sequence
77
Super Mario 64 (Nintendo 1996)
78
Super Mario Strikers (Nintendo 2005)
79
Tomb Raider 1 (1996)
80
Tomb Raider 7 (2006)
81
High poly count modelingFinal Fantasy Advent
Children (2005)
82
High poly count modelingFinal Fantasy Advent
Children (2005)
Write a Comment
User Comments (0)
About PowerShow.com