Three Dimensional Object Representation

Slides:



Advertisements
Similar presentations
Lecture Notes #11 Curves and Surfaces II
Advertisements

Lecture 10 Curves and Surfaces I
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
© University of Wisconsin, CS559 Spring 2004
Dr. S.M. Malaek Assistant: M. Younesi
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
1 Computer Graphics Chapter 7 3D Object Modeling.
Curves Chiew-Lan Tai. Curves 2 Reading Required Hearn & Baker, 8-8 – 8-10, 8-12 Foley, 11.2.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Curves Mortenson Chapter 2-5 and Angel Chapter 9
Modelling: Curves Week 11, Wed Mar 23
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
Curve Surfaces June 4, Examples of Curve Surfaces Spheres The body of a car Almost everything in nature.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Curve Modeling Bézier Curves
Bresenham’s Algorithm. Line Drawing Reference: Edward Angel’s book: –6 th Ed. Sections 6.8 and 6.9 Assuming: –Clipped (to fall within the window) –2D.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Intelligent Engineering Systems Lecture 3. Description.
Spline Representations
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
Geometric Modelling 2 INFO410 & INFO350 S Jack Pinches
Keyframing and Splines Jehee Lee Seoul National University.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS Representation of Curves and Surfaces Graphics.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Basic Theory (for curve 02). 1.3 Parametric Curves  The main aim of computer graphics is to display an arbitrary surface so that it looks real.  The.
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
Introduction to Curves
1 대상물체의 형상화를 위해 사용되는 기술  인공물체 : 기하학적 Primitive ( 선, 면, 구, 육면체 ) 등을 이 용하여 형상화. 입력물 : 형상화 물체의 3 차원 좌표값 출력물 : 선구조형상 (Wire framed objects) Technique:Geometric.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Piecewise Polynomial Parametric Curves Sun-Jeong Kim.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Slide 1Lecture Fall ‘00 Surface Modeling Types: Polygon surfaces Curved surfaces Volumes Generating models: Interactive Procedural.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
Constructing Objects in Computer Graphics
Surfaces and Curves.
CS5500 Computer Graphics May 11, 2006
Curve & Surface.
Representation of Curves & Surfaces
Parametric Curves cgvr.korea.ac.kr.
(Spline, Bezier, B-Spline)
Chapter 10-2: Curves.
Constructing Objects in Computer Graphics By Andries van Dam©
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Fall 2004
CURVES CAD/CAM/CAE.
© University of Wisconsin, CS559 Spring 2004
Chapter XVII Parametric Curves and Surfaces
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
UNIT-5 Curves and Surfaces.
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
3-Dimensional Object Representation
Spline representation. ❖ A spline is a flexible strip used to produce a smooth curve through a designated set of points. ❖ Mathematically describe such.
Type to enter a caption. Computer Graphics Week 10 Lecture 2.
Presentation transcript:

Three Dimensional Object Representation

Modeling of object or picture means describing them to the computer so as to produce visual display that simulate the real thing For describing we need a set of primitives /geometric forms Complex Simple Curved Segment Curved Surface Quadratic Surface Points Lines Poly lines Polygon Polyhedron Highly realistic representation tse color, shading & texture

Point Pt p in 2D p(x,y) and in 3D p(x,y,z) Line In 2D it specified by end pt (x1,y1) to (x2,y2) In 3D it specified by end pt (x1,y1,z1) to (x2,y2,z2) Poly Line Chain of connected line segments from pt p0 to pn Polygons A closed poly lines where initial pt & final pt coincide. It is specified by vertex & edge information Planner polygon – When all vertex lie on same plane Polyhedron A closed polygonal net in which each polygon (face) is planner. It is solid object

Wireframe Model Representation of polygonal net/ polygonal mesh Here representation of any 3D object can be done by vertex, edge and polygon information In 3 ways we can represent Explicit vertex list Polygon Listing Explicit edge Listing

Representation of this object D Problem Representation of this object H E B A Explicit vertex list G F Here the information of the object will be stored in the order in which they will be encountered by travelling around the complete model Let the travelling sequence is --- A -> B -> C -> D ->A -> F -> E -> D -> C ->H ->E -> F -> G -> H->G ->B C D H E B A G F

Disadvantage Inefficient for a complete polygonal net where shared vertices are repeated several time. ( More space complexity) For displaying the polygonal net from this type of stored information shared edges are drawn several times (More time complexity) Advantage It is useful for single polygon.

Here each vertex is stored exactly once in vertex list V= (v0 ..vn) Polygon listing Here each vertex is stored exactly once in vertex list V= (v0 ..vn) Here each polygon is stored exactly once in polygon list by pointing or indexing to the vertex list The vertex list is --- V={A,B,C,D,E,F,G,H} The polygon list is -- P= {p1,p2,p3,p4,p5,p6} P1 ={A,B,C,D}  {V(0),V(1),V(2),V(4)} P2 = {C,D,E,H}  P3 = {A,B,E,F}  P4 = {A,B,G,F}  P6 ={E,F,G,H}  {V(4),V(5),V(6),V(7)} D C H E B A G F

Disadvantage Shared edges are drawn several times in displaying through this method (time complexity) Advantage More efficient than explicit vertex list

Here each vertex is stored exactly once in vertex list V= (p0 ..pn) Edge listing Here each vertex is stored exactly once in vertex list V= (p0 ..pn) Each edge is stored exactly once in edge list by pointing to the 2 vertex of vertex list for defining every edge. Each polygon is stored exactly once in polygon list by pointing or indexing to the edge list Drawing will be done by considering the edge list C D H E B A G F

Advantage (of wire frame model) Disadvantage none Advantage used to represent more general wireframe model Advantage (of wire frame model) Wire frame model are used in engineering application As they are composed of straight lines  Easy to construct  Easy to clip & manipulate Disadvantage (of wire frame model) For achieving the realistic model which are highly curved object , here huge no of polygons are needed

Plane Equation To produce a display of 3 dimensional object, we need the information of spatial orientation of the individual surface components of the object. This information is obtained from vertex coordinate value and equation that describes the polygon plane. The equation of plane surface:- where (x, y, z) is any point on the plane. and A,B,C,D describes spatial property of the plane, (whose value can be obtained by solving a set of 3 plane equations using the coordinate values for 3 nonlinear points in the plane). Ax + By + Cz + D =0

the point (x,y,z) is inside the surface We need to distinguish the side of the polygon surfaces which enclose the object interior Inside face:- The side of the plane that faces the object interior. Outside face :- The side of the plane that faces the object exterior or visible. The position of a spatial point (x,y,z) relative to plane surface of an object can be identified using plane equation. the point (x,y,z) is inside the surface the point (x,y,z) is outside the surface Ax + By + Cz + D <0 Ax + By + Cz + D >0

Why have curves ? Representation of “irregular surfaces” Example: Artist’s representation Auto industry (car body design) Clay / wood models Tool and die Manufacturing

“Computers can’t draw curves.” The more points/line segments that are used, the smoother the curve.

Classification of Curves Analytical Curves: This type of curve can be represented by a simple mathematical equation, such as, a circle or an ellipse. They have a fixed form and cannot be modified to achieve a shape that violates the mathematical equations Interpolated curves: An interpolated curve is drawn by interpolating the given data points and has a fixed form, dictated by the given data points. These curves have some limited flexibility in shape creation, dictated by the data points. Approximated Curves: These curves provide the most flexibility in drawing curves of very complex shapes. The model of a curved automobile fender (a plastic cylinder, tyre)can be easily created with the help of approximated curves and surfaces.

Parametric and Non-parametric Equations of a Curve The mathematical representation of a curve can be classified as either parametric or nonparametric 1 Nonparametric: - Explicit non-parametric eqtation : y = mx + c y = c1 + c2 x + c3 x 2 + c4 x 3 There is a unique single value of the dependent variable for each value of the independent variable. Implicit non-parametric equation : Ax + By + C = 0 (x – xc)2 + (y – yc)2 = r2 No distinction is made between the dependent and the independent variables

2. Parametric: Parametric equations describe the dependent and independent variables in terms of a parameter. Parametric curves can be defined in a constrained period (0 ≤ t ≤ 1); since curves are usually bounded in computer graphics, this characteristic is of considerable importance Line :- x = x1 + (x2 - x1) t where, 0 ≤ t ≤ 1 y = y1 + (y2 - y1) t circle :- x = r cosθ, y = r sinθ where 0 ≤ θ ≤ 2π Ellipse:- x = rx cosθ, y = ry sinθ

Curve representation Problem: How to represent a curve easily and efficiently “Brute force and ignorance” approaches: storing a curve as many small straight line segments doesn’t work well when scaled inconvenient to have to specify so many points need lots of points to make the curve look smooth working out the equation that represents the curve difficult for complex curves moving an individual point requires re-calculation of the entire curve

Requirements Want mathematical smoothness Local control Some number of continuous derivatives of P Local control Local data changes have local effect Continuous with respect to the data No wiggling if data changes slightly Low computational effort

A solution use SEVERAL polynomials Complete curve consists of several pieces All pieces are of low order Third order is the most common Pieces join smoothly This is the idea of spline curves or just “splines”

Parametric cubic curves General form:

General curve shape may be generated using method of Interpolation (also known as curve fitting) Curve will pass through control points Approximation Curve will pass near control points may interpolate the start and end points.

Curve algorithm Interpolation Approximation

Interpolation vs approximation f(x) curve most pass through control points curve is influenced by control points x f(x)

Interpolation Curves Curve is constrained to pass through all control points Given points P0, P1, ... Pn, find lowest degree polynomial which passes through the points x(t) = an-1tn-1 + .... + a2t2 + a1t + a0 y(t) = bn-1tn-1 + .... + b2t2 + b1t + b0

Interpolating curve : piecewise linear Example: Hermite Curve Curve defined by multiple segments (linear) which are defined by polynomial functions (cubic functions). Segments joints known as KNOTS Requires too many data points for most shape Representation not flexible enough to editing

Approximation techniques Developed to permit greater design flexibility in the generation of free form curves Common methods in modern CAD systems, bezier, b-spline, NtRBS Employ control points (set of vertices that approximate the curve)

Approximation techniques Curves do not pass directly through points (except start and end) Intermediate points affect shape as if exerting a “pull” on the curve. Allow user to set shape by “pulling” out curve using control point location.

Example – bezier curve

Interpolation vs. Approximation Curves Interpolation Curve – over constrained → lots of (undesirable?) oscillations Approximation Curve – more reasonable?

Blending Functions used to derive the points on curve can be:- When modelling a curve f(x) by using segments we represent the curve as sum of smaller segments Øi(x) called blending functions. Blending Functions used to derive the points on curve can be:- Lagrange Polynomial Hermite Polynomial Bernstein Polynomial

Spline Representation What is -- Spline Spline Curve Spline Surface

Spline weights are used to make curve without computer Making Curves Spline weights are used to make curve without computer

Natural Cubic Spline Spline 1 A long narrow and relatively thin piece or strip of wood, metal, etc. 2 A flexible strip of wood or rubber used by draftsmen in laying out broad sweeping curves, as in railroad work. Spline Curve is a composite curve formed with polynomial section satisfying specified continuity (smoothness) condition at the boundary. Spline surface can be described with 2 sets of orthogonal spline curve.

Bezier Curve For n+1 control points pi (0 <= I <= n) the following is the approximated position vector using Bezier polynomial ftnction Where B(t)  position vector of curve Pi  control points bi,n(t) Bezier blending function (Bernstein polynomial)

Linear Curve (2 control points) B(t) = (1-t) P0 + t P1 The parameter ‘t’ defines the path of curve B(t) from P0 to P1

Qtadratic Bezier Curve (3 control points) For the Quadratic Bezier curve B(t) from Q0 to Q1 t varies from 0 to 1. Q0 varies from p0 to p1 describes a linear Bezier curve. Q1 varies from p1 to p2 B(t) varies from Q0 to Q1 describes a Quadratic Bezier curve.

B(t) = (1-t)2 P0 + 2t (1-t) P1 + t2 P2 Quadratic: Degree 2, Order 3 B(0) = P0, B(1) = P2 B(t) = ? P0 P1 P2 1-t t Q0(t) Q1(t) 1-t t B(t) B(t) = (1-t)2 P0 + 2t (1-t) P1 + t2 P2

Cubic Curve (4 control points)

For the Cubic Bezier curve B(t) from R0 to R1 t varies from 0 to 1. Q0 varies from p0 to p1 describes a linear Bezier curve. Q1 varies from p1 to p2 Q2 varies from p2 to p3 R0 varies from Q0 to Q1 describes a Quadratic Bezier curve. R1 varies from Q1 to Q2 B(t) varies from R0 to R1 describes a Cubic Bezier curve.

B(t) = (1-t)3 P0 +3t(1-t)2 P1 +3t2(1-t) P2 + t3 P3 Cubic: Degree 3, Order 4 B(0) = P0, B(1) = P2 B(t) = ? P0 P1 P2 P3 1-t t B(t) = (1-t)3 P0 +3t(1-t)2 P1 +3t2(1-t) P2 + t3 P3 t t 1-t Q0(t) Q1(t) Q2(t) t 1-t t 1-t R0(t) R1(t) 1-t t B(t)

For higher order curve

Properties of Bezier curve 1. The Bézier curve generally follows the shape of the control polygon, which consists of the segments joining the control points

2. Bézier curves exhibit global control: moving a control point alters the shape of the whole curve.

3. Interpolation. A Bézier curve always interpolates the end control points.s 4. Tangency. The endpoint tangent vectors are parallel to P1- P0 and Pn- Pn-1. 5. Convex hull property. The curve is contained in the convex hull of its defining control points. Use:- (Due to it’s property & easy implementation) Available in CAD system In general graphics package In drawing & painting package