Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Graphics Lecture 37

Similar presentations


Presentation on theme: "Computer Graphics Lecture 37"— Presentation transcript:

1 Computer Graphics Lecture 37

2 CURVES III Taqdees A. Siddiqi cs602@vu.edu.pk

3 The Tangent Vector

4 Another way to define a space curve does not use intermediate points
Another way to define a space curve does not use intermediate points. It uses the tangents at each end of a curve, instead

5 Every point on a curve has a straight line associated with it called the tangent line, which is related to the first derivation of the Parametric functions x(u), y(u), and z(u)

6 Equation (1)

7 From elementary calculus, we can compute, for example,

8 Equation (2)

9 We can treat as components of a vector along the tangent line to the curve. We call this the tangent vector, and define it as

10 Equation (3)

11 Or more simply as Equation (4)

12 (Here the superscript u indicates the first derivative operation with respect to the independent variable u). This is a very powerful idea, and we will now see how to use it to define a curve

13 We will still use the two end points, but instead of two intermediate points, we will use the tangent vectors at each end to supply the information we need to define a curve

14 By manipulating these tangent vectors, we can control the slope at each end. The set of vectors , ,, and are called the boundary conditions

15 This method itself is called the cubic Hermite interpolation, after C
This method itself is called the cubic Hermite interpolation, after C. Hermite ( ) the French mathematician who made significant contributions to our understanding of cubic and quadratic polynomials.

16 We differentiate to obtain the x component of the tangent vector:

17 Equation (5)

18 P1 P0 Pu1 Pu0 Figure (1)

19 Equation (1A)

20 Evaluating (1A) and Equation 5 at u = 0, u = 1, yields

21 Equation (6)

22 Using these four equations in four unknowns, we solve for ax , bx , cx and dx in terms of the boundary conditions

23 Equation (7)

24 Substituting the result into Equation (1A), yields

25 Rearranging terms we can rewrite this as
Equation (9)

26 Because y(u) and z(u) have equivalent forms, we can include them by rewriting Equation 9 in vector form:

27 Equation (10)

28 To express Equation 14.54 in matrix notation, we first define a blending function matrix
Where

29 Equation (11)

30 These matrix elements are the polynomial coefficients of the vectors which we rewrite as:

31 Equation (12)

32 If we assemble the vectors representing the boundary conditions into a matrix B,

33 Equation (13)

34 Then Equation (14)

35 Here again we write the matrix F as the product of two matrices, U and M, so that

36 Equation (15)

37 where Equation (16)

38 And Equation (17)

39 Rewriting Equation 14 using these substitutions, we obtain

40 It is easy to show the relationship between the algebraic and geometric coefficients for a space curve. Since

41 Equation (19)

42 the relationship between A and B is, again,
Equation (20)

43 The magnitude of the tangent vector is also necessary and contributes to the shape of the curve. In fact, we can write and as

44 Equation (21)

45 And Equation (22)

46 Clearly, m0, and m1 are the magnitudes of and .
Using these relationships, we modify Equation 10 as follows:

47 Equation (23)

48 Computer Graphics Lecture 37

49 To define a space curve we must use parametric functions that are cubic polynomials. For x(u) we write: Equation (1)

50 A space curve is not confined to a plane
A space curve is not confined to a plane. It is free to twist through space.

51 Space Curves

52 we combine the x(u), y(u) and z(u) expressions into a single vector equation :

53 If a = 0, then his equation is identical to Equation discussed in plane curves

54 So we now have the four points we need.
x y z P1 P1/3 P0 P2/3

55 So we now have the four points we need.
x y z P1 P1/3 P0 P2/3

56 Equation (3)

57 Equation (4)

58 Equation (5)

59 Rewriting Equation 5 as follows:

60 Equation (7)

61 This means that, given four point assigned successive values of u (in this case at u=0, 1/3, 2/3 & 1), equation 7 produces a curve that starts at p1, passes through p2 and p3, and ends at p4.

62 Now let’s take one more step towards a more compact notation
Now let’s take one more step towards a more compact notation. Using the four parametric functions appearing in Equation 7, we define a new matrix, where

63 Equation (8)

64 And then define a matrix P containing the control points,
so that Equation (9)

65 The matrix G is the product of two other matrices, U and N:
Equation (10)

66 Where And Equation (11)

67 Equation (12)

68 Using matrices, Equation 2 becomes

69 And then Equation (14) And then Equation (15)

70 Or more simply Equation (16)

71 which we can rewrite as the more convenient p1, p2, p3, and p4 (Figure 1).


Download ppt "Computer Graphics Lecture 37"

Similar presentations


Ads by Google