GRPHICS03 - Graphical Representation

22
GRAPHICAL REPRESENTATION Michael Heron

description

This is a course on the theoretical underpinnings of 3D Graphics in computing, suitable for students with a suitable grounding in technical computing.

Transcript of GRPHICS03 - Graphical Representation

Page 1: GRPHICS03 - Graphical Representation

GRAPHICAL REPRESENTATIONMichael Heron

Page 2: GRPHICS03 - Graphical Representation

INTRODUCTION

In the last lecture we talked about the processes we go through to build a 3D object. We focused primarily on the polymesh.

In this lecture we are going to look at alternate representations. Bezier curves Bezier Patches NURBS surfaces Constructive Solid Geometry

Page 3: GRPHICS03 - Graphical Representation

BEZIER CURVES

A Bezier Curve (or Bezier spline) is a curve defined through the use of four vertices. A start and end vertice Two supplementary vertices that define the

curve. Known as the control points.

P1

P2P3

P4

Page 4: GRPHICS03 - Graphical Representation

BEZIER CURVES

By manipulating the control points, we can change the nature of the curve. Governed by a mathematical formula.

P1

P2

P3

P4

Page 5: GRPHICS03 - Graphical Representation

BEZIER CURVES

Bezier curves are used for: Modelling smooth curves

In a way that cannot be done with a polymesh Curves appear smooth at all scales

Font representation Vector/Outline fonts

Animation Used to define smooth, realistic paths for movement.

Page 6: GRPHICS03 - Graphical Representation

BEZIER PATCHES

Related to the idea of a Bezier curve is a Bezier patch. Curves are 2D, patches are 3D

Bezier patches are shaped nets, the appearance of which are determined by control points. Control points act like gravity spots on

underlying shape. The define the topology of the shape through

mathematical modelling of attraction

Page 7: GRPHICS03 - Graphical Representation

BEZIER PATCHES

http://mathforum.org/sketchpad/misc.html

Page 8: GRPHICS03 - Graphical Representation

BEZIER PATCHES

Bezier patches offer several advantages Integrity of representation

Continuity across boundaries Awareness of neighbours

Fluid representation Exact representation

Can measure volumes and surfaces Economical

A single patch can represent many polygonal equivalents.

Page 9: GRPHICS03 - Graphical Representation

BEZIER PATCHES

However, they also have drawbacks. Simple patch has 16 control points.

Rendering with a Bezier patch is expensive. Around 10 times slower than equivalent

polymesh But this does not take into account the difference in

time requirements to model a polymesh correctly. Large number of perspectives required to render

properly.

Page 10: GRPHICS03 - Graphical Representation

NURBS

Non-Uniform Rational B-Splines Yikes!

Extension of the idea of a Bezier curve Defined by control points.

Each control point has a weight Defines how much that control point influences

the curve. NURBS have knots

Vectors that describe how the resulting curve is influenced by the control points.

NURBS have an order How closely the curve follows the lines between

control points.

Page 11: GRPHICS03 - Graphical Representation

CONSTRUCTIVE SOLID GEOMETRY

Complex shapes modeled by using simple shapes. To these shapes we add or subtract other simple

shapes. Combination of shapes using boolean

operators and set theory allows for new and interesting complex topographies. Unions, Intersections, etc

Page 12: GRPHICS03 - Graphical Representation

CSG EXAMPLES

Images here show boolean operations – union, intersection, and difference.

http://www.student.cs.uwaterloo.ca/~cs488/Contrib/f02/a5/djbigham/

Page 13: GRPHICS03 - Graphical Representation

INTERSECTIONS

When two primitives intersect, the new object is the volume shared by both shapes

Page 14: GRPHICS03 - Graphical Representation

DIFFERENCE

Difference is all the bits that don’t intersect.

Page 15: GRPHICS03 - Graphical Representation

UNION

A union is both shapes together. A merge, in other words.

The new object can be treated as a single new shape And be transformed as a holistic unit.

Page 16: GRPHICS03 - Graphical Representation

VOXEL REPRESENTATION

Sometimes need to represent 3D space as voxels. 3D Pixels

3D space broken up into three dimensional arrays of voxels.

Each voxel labeled according to its object occupancy.

Page 17: GRPHICS03 - Graphical Representation

VOXEL REPRESENTATION

Voxel arrays are: Costly in terms of memory

Entire object space must be separated down into cubic elements

Labelled according to object occupancy Space subdivision

Frequently used in: Game representations of terrain Medical imagery Ray tracing

Page 18: GRPHICS03 - Graphical Representation

SPACE SUBDIVISION

Process of space subdivision common to 2D and 3D graphics. Easier to understand in 3D.

Start with a 1x1 square representing entire image. Then recursively subdivide squares.

Stop when each pixel inside a subdivided square has a single colour.

Page 19: GRPHICS03 - Graphical Representation

SPACE SUBDIVISION

Page 20: GRPHICS03 - Graphical Representation

SPACE SUBDIVISION

Page 21: GRPHICS03 - Graphical Representation

VOLUME SUBDIVISON

Works the same way in 3D as in 2D We start with cubes Recursive subdivide cubes

From our cube, subdivide into eight smaller cubes.

Can represent space/volume subdivision as a tree data structure. Easy to navigate and store

Offers greater efficiency of representation. Advancement over simple voxel array.

Page 22: GRPHICS03 - Graphical Representation

SUMMARY

Various ways to represent 3D graphics beyond polymeshes. Bezier Curves Bezier Patches NURBS CSG Space Subdivision

Each technique has its real life applications. The nature of the intended destination will

dictate the appropriate tool.