in the name of god computer graphics. introduction modeling techniques modeling techniques...

21
In the name of God Computer Graphics

Upload: ethel-sutton

Post on 06-Jan-2018

215 views

Category:

Documents


0 download

DESCRIPTION

Last Time Intro to modeling Issues in evaluating modeling techniques: –How well does it represent objects? –What types of objects can it represent? –How easy is it to render? –How compact is it? –How easy is it to create/modify? –How easy is it to perform geometric computations? Polygonal modeling –A multitude of ways to represent polygonal models and associated data

TRANSCRIPT

Page 1: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

In the name of God

Computer Graphics

Page 2: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Introduction

• Modeling techniques• modeling techniques managements • Some renderings

Page 3: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Last Time

• Intro to modeling• Issues in evaluating modeling techniques:

– How well does it represent objects?– What types of objects can it represent?– How easy is it to render?– How compact is it?– How easy is it to create/modify?– How easy is it to perform geometric computations?

• Polygonal modeling– A multitude of ways to represent polygonal models and

associated data

Page 4: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Other Object Representations

• Parametric instancing• Hierarchical modeling• Constructive Solid Geometry• Octrees• Blobs and Metaballs and other such things• Production rules• + Polygonal modeling

Page 5: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Modeling managements

• Modeling format is based on application– Provide software that knows how to draw the object

given the parameters, or knows how to produce a polygonal mesh

– Managing the model depends on the rendering style– Can be an exact representation

Page 6: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Parametric Instancing

• Many primitives are conveniently described by a label and a few parameters– Cylinder: Radius, length, does it have end-caps,

…– Other examples

Page 7: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Hierarchical Modeling• A hierarchical model unites several parametric instances

into one object– For example: a desk is made up of many cubes– Other examples

• Generally represented as a tree, with transformations and instances at any node

• Rendered by traversing the tree, applying the transformations, and rendering the instances

• Particularly useful for animation– Human is a hierarchy of body, head, upper arm, lower arm, etc…– Animate by changing the transformations at the nodes

Page 8: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Hierarchical Model Example

Draw body

left armxarm

lRotate about shoulderDraw upper arm

Translate (l,0,0)Rotate about origin oflower armDraw lower arm

Important Point:•Every node has its own local coordinate system.•This makes specifying transformations easier.

Page 9: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Regularized Boolean Set Operations• Hierarchical modeling is not good enough if

objects in the hierarchy intersect (cut each other)– Transparency will allow internal surfaces that should not exist– Computing properties like mass may count the same volume twice

• Solution is to define regularized set operations:– Every object must be a closed volume (mathematically closed)– Define mathematical set operations (union, intersection,

difference, complement) to the sets of points within the volume

Page 10: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Constructive Solid Geometry (CSG)

• Based on a tree structure, like hierarchical modeling, but:

– The internal nodes are set operations: union, intersection or difference (sometimes complement)

– The edges of the tree have transformations associated with them– The leaves contain only geometry

• Allows complex shapes with only a few primitives– Common primitives are cylinders, cubes, etc, or quadric surfaces

• Motivated by computer aided design and manufacture– A common format in CAD products

Page 11: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

CSG Example

cylinder cylinder

scaletranslate

scaletranslate

Page 12: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

CSG Summary• Advantages:

– Good for describing many things– Better if the primitive set is rich

• Early systems used quadratic surfaces– Easy to understand

• Disadvantages:– Not a good match for polygon renderers– Some objects may be very hard to describe, if at all

• Geometric computations are sometimes easy, sometimes hard• A volume representation (hence solid in the name)

– Boundary (surface representation) can also work

Page 13: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Spatial Enumeration

• Basic idea: Describe something by the space it occupies– For example, break the volume of interest into lots of tiny

cubes, and say which cubes are inside the object– Works well for things like medical data

• The process itself, like MRI or CAT scans, enumerates the volume• Data is associated with each voxel (volume element)

• Problem to overcome:– For anything other than small volumes or low resolutions, the

number of voxels explodes– Note that the number of voxels grows with the cube of linear

dimension

Page 14: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Octrees (and Quadtrees)

• Build a tree where successive levels represent better resolution (smaller voxels)

• Large uniform spaces result in shallow trees• Quadtree is for 2D (four children for each

node)• Octree is for 3D (eight children for each

node)

Page 15: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Quadtree Example

top left top right bot left bot right

Octree principle is the same, but there are 8 children

Page 16: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Blobs and Metaballs

• Define the location of some points• For each point, define a function on the distance to

a given point, (x,y,z)• Sum these functions up, and use them as an

implicit function

• More generally, use Gaussian functions of distance, or other forms– Various results are called blobs or metaballs

Page 17: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Example with Blobs

Rendered with POVray. Not everything is a blob, but the characters are.

Page 18: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Production Rules• Model by giving a set of rules to follow to generate it• Works best for things like plants:

– Start with a stem– Replace it with stem + branches– Replace some part with more stem + branches, and so on

• Essentially, generate a string that describes the object by replacing sub-strings with new sub-strings

• Render by generating geometry– Parametric instances of branch, leaf, flower, etc– Or polygons, or blobs, or …

• Can work for whole gardens and forests

Page 19: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

L-Systems

Prusinkiewicz, Hammel, Mech http://www.cpsc.ucalgary.ca/projects/bmv/vmm/title.html

Page 20: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

More L-Systems

Prusinkiewicz, Hammel, Mech http://www.cpsc.ucalgary.ca/projects/bmv/vmm/title.html

Page 21: In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings

Yet More L-systems

Prusinkiewicz, Hammel, Mech http://www.cpsc.ucalgary.ca/projects/bmv/vmm/title.html