Presentation is loading. Please wait.

Presentation is loading. Please wait.

Three Dimensional Object Representation

Similar presentations


Presentation on theme: "Three Dimensional Object Representation"— Presentation transcript:

1 Three Dimensional Object Representation

2 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

3 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

4 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

5 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

6 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.

7 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

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

9 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

10 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

11 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

12 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

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

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

15 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.

16 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

17 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θ

18 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

19 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

20 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”

21

22

23 Parametric cubic curves
General form:

24 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.

25 Curve algorithm Interpolation Approximation

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

27 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 a2t2 + a1t + a0 y(t) = bn-1tn b2t2 + b1t + b0

28 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

29 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)

30 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.

31 Example – bezier curve

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

33 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

34 Spline Representation
What is Spline Spline Curve Spline Surface

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

36 Natural Cubic Spline Spline 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.

37 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)

38 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

39 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.

40 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

41 Cubic Curve (4 control points)

42 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.

43 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)

44 For higher order curve

45 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

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

47 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 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

48


Download ppt "Three Dimensional Object Representation"

Similar presentations


Ads by Google