We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS 602 Computer Graphics Assignment No 5 Solution & Discussion Due Date:11-07-2012

Assignment

Q1.            Discuss the characteristic features of Bezier Curves.                    Marks (5)

Q2.            Discuss the parametric equation of Cubic Spline Curves and how these equations can be represented by vector.                               Marks (5)

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 267

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

### Replies to This Discussion

any one share idea?

hello sana g if you have any idea so please share with me ....

second q hint

Parametric Cubic Curves

In computer graphics you'll often need to draw curves, and there are times when a line list just won't cut it.  What you want is something continuous.   Something that is differentiable.  Something that can be rendered with infinite precision.  The cubic curve, my friend, is just the beast you seek.

The parametric function is, of course, our weapon of choice.   Slope-intercept and general form equations have an annoying attribute that make them impossible to work with: namely, the geometric slope of a function may be infinite, creating a mathematical singularity.  Parametric curves, however, never have infinite slopes.  Our curve is described by a piecewise polynomial, that is, by a function x, a function y, and a function z.   In a slope-intercept form function, the slope of a curve is defined by the infamous three words: "rise over run."  When the "run" is zero, a dimensional vortex opens and sucks you away to the outer limits.   Parametric functions, on the other hand, define slope as the sum of the parametric velocities: dx/dt i + dy/dt j + dz/dt k.   Because we are limiting ourselves to parametric polynomials, these derivatives are always defined.  Oh, happy day.

Our cubic curve can exist in any dimension.  A one dimensional curve looks like a line segment; that isn't too interesting.  A parametric curve defined with four or more piecewise polynomials is impossible to draw.  Applications always use two and three dimensional cubic curves.

We define our cubic curve as the function Q(t).  This function is in turn defined as a set of polynomials:

Q(t) = [ f1(t)   f2(t)   ...   fn-1(t)   fn(t) ]    , n = dimension of curve

f1(t) = a1t3 + b1t2 + c1t + d1      , 0 £ t £ 1

...

fn(t) = ant3 + bnt2 + cnt + dn

Parametric equations are powerful and flexible. Perhaps the most familiar example is the equation of a circle in the form x = r*cos(θ), y = r*sin(θ). In this case, the parameter θ is the independent variable and increases monotonically (i.e. each successive value is larger than the previous one, which is a requirement of parametric equations in general), and x and y are dependent variables. The resulting plot of y vs x can wrap on itself, which a circle indeed does. There are many forms of polynomial parametric equations (e.g. Bezier, B-Spline, NURBS, Catmull-Rom) that have entire books devoted to their understanding and use. In this tutorial, we offer a brief introduction by way of examples to provide a basic understanding of the relative simplicity of parametric equations. Specifically, we will build upon the tools learned in the cubic spline tutorial (http://www.vbforums.com/showthread.php?t=480806) to extend our knowledge to parametric cubic splines.

Recall that a cubic spline is nothing more than a sequence of 3rd order polynomials joined at the endpoints with enforced 1st and 2nd derivative compatibility at interior points and specified end conditions at the free ends. Extending this concept to parametric splines just means formulating two sets of equations instead of one using the exact same methodology as a standard (non parametric) cubic spline. In the case of parametric cubic splines, each spline segment is represented by 2 equations in an independent variable s:

x = f1(s) = ax(s-s0)3 + bx(s-s0)2 + cx(s-s0) + dx
y = f2(s) = ay(s-s0)3 + by(s-s0)2 + cy(s-s0) + dy

where s0 represents the value of the independent variable s at the beginning of the segment. Though not required, it is convenient to have s vary from 0 to 1. To get an idea of how powerful these equations are, consider the following simple equations for x & y:

x = 26s3 - 40s2 + 15s - 1
y = -4s2 + 3s

The resulting plot of y vs x (for s = 0 to 1) is truly amazing. It almost seems magical that a single cubic polynomial (well, two actually) can generate such a complicated shape. That’s the power of parametric

Parametric Cubic Spline continued...

The methodology for determining the coefficients of the parametric cubic polynomials is exactly the same as before. The trick is to determine the values of the independent variable, s. One method is to use distance along the curve (arc length), or an approximation thereof. The values of the parameter s will be formed by summing the distances between the points, (Δx2 + Δy2)1/2. The key is to sum the distances in the sequence that the curve is to follow. In this case:

p1 = [1,0]
p2 = [-1, 0]
p3 = [0, 1]
p4 = [0, -1]

Calculating the distances between points:

d12 = sqrt[(-1 - 1)2 + (0 – 0)2] = sqrt[4 + 0] = 2 ==> s2 = 2
d23 = sqrt[(-1 – 0)2 + (0 – 1)2] = sqrt[1 + 1] = 1.414 ==> s3 = s2 + 1.414 = 3.414
d34 = sqrt[(0 – 0)2 + (-1 – 1)2] = sqrt[0 + 4] = 2 ==> s4 = s3 + 2 = 5.414

And the starting point is s1 = 0. As stated before, though not required, it is convenient (mainly for plotting purposes) to scale the values of s to range from 0 to 1. In this case, we just divide each value by s4 (i.e. 5.414):

s1 = 0
s2 = 0.369

## Latest Activity

+ ! Suspecious+ liked + ! Suspecious+'s discussion محبت یا خود غرضی؟؟؟؟؟
45 minutes ago
+ ! Suspecious+ posted discussions
48 minutes ago
51 minutes ago
1 hour ago
Ateeqa liked + ! ! ! ! ! ! Mobi's profile
1 hour ago
++PrInCeSss++ posted a discussion

### Black Day

1 hour ago
Mohammad Moeen Aslam joined + M.Tariq Malik's group

1 hour ago
2 hours ago
2 hours ago
2 hours ago
2 hours ago

1

2

3