CSC 308 – Graphics Programming. Curves Information modified from Ferguson’s “Computer Graphics via Java”, and “Principles of Three-Dimensional Animation, Third Ed.” by M. O’Rourke. Dr. Paige H. Meeker Computer Science Presbyterian College, Clinton, SC. First, a few announcements….
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Information modified from Ferguson’s “Computer Graphics via Java”, and
“Principles of Three-Dimensional Animation, Third Ed.” by M. O’Rourke
Dr. Paige H. Meeker
Presbyterian College, Clinton, SC
We’ve been working in the world of straight lines – this not being particularly natural, let’s take a look at what curves can do!
The term “spline” comes from the shipping era, when ships were made from wood. To build a plank of wood that would conform to the ship’s hull, shipbuilders would force the wooden plank between several fixed posts, called “ducks.” The result was a curved plank called a “spline.” The placement of the ducks determined how much curvature the finished spline would have.
Computer graphics version:
There is a direct relationship between the control points and the final curve.
Cardinal Spline – type of interpolating spline where the curve passes through all the control points except the first and last; 2nd degree curve.
Spline passes near but not through the control points
B-spline (Basis Spline)
The general form of a cubic parametric equation (in t) is:
xt = a0 + a1t + a2t2 + a3t3
similarly for y
yt = b0 + b1t + b2t2 + b3t3
Ni-1Obtaining a0, a1, a2 & a3
Gradient at the end of segment Si = gradient at the beginning of Si+1. What is the gradient? To find it…
x= 2(0.5-t)(1-t)xNi-1 + 4t(1-t)xNi + 2t(t-0.5)xNi+1