Description

#7: Cubic Bends CSE167: PC Illustrations Educator: Ronen Barzel UCSD, Winter 2006 Diagram throughout today Inverses of Changes Bends outline B é zier bends Design pipeline changes Recollect the arrangement of changes in the representation funnel:

Transcripts

#7: Cubic Curves CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

Outline throughout today Inverses of Transforms Curves diagram B Ã© zier bends

Graphics pipeline changes Remember the arrangement of changes in the representation funnel: M - model: spots object in world space C - camera: places camera in world space P - projection: from camera space to standardized perspective space D - viewport: remaps to picture facilitates And recollect about C: helpful for situating the camera as a model in reverse for the pipeline: we have to get from world space to camera space So we have to utilize C - 1 Youâll need it for task 4: OpenGL needs you to load C - 1 as the base of the MODELVIEW stack

How would we get C - 1 ? Could build C , and utilize a grid backwards routine Would work. Be that as it may, generally moderate. Also, we didnât give you one :) Instead, letâs develop C - 1 specifically in view of how we built C in light of alternate ways and tenets for relative changes

Inverse of an interpretation Translate back, i.e., invalidate the interpretation vector Easy to check:

Inverse of a Scale by the inverses Easy to confirm:

Inverse of a turn Rotate about the same hub, with the restrict edge: Inverse of a pivot is the transpose: Columns of a pivot framework are orthonormal A T A creates all columnsâ spot item mixes as network Dot result of a section with itself = 1 (on the corner to corner) Dot result of a segment with some other segment = 0 (off the askew)

Inverses of structure If you have a progression of changes formed together

Composing with inverses, pictorially To travel between various spaces, make along bolts Backwards along bolt: utilize opposite change

Model-to-Camera change Camera-to-world C Model-to-Camera = C - 1 M y z x Camera Space

The take a gander at change Remember, we developed C utilizing the take a gander at expression:

C - 1 from a,b,c,d segments

Outline throughout today Inverses of Transforms Curves review B Ã© zier bends

Usefulness of bends in demonstrating Surface of unrest

Usefulness of bends in displaying Extruded/cleared surfaces

Usefulness of bends in demonstrating Surface patches

Usefulness of bends in liveliness Provide a âtrackâ for articles http://www.f-lohmueller.de/

Usefulness of bends in activity Specify parameter values after some time: 2D bend edtior

How to speak to bends Specify each point along a bend? Utilized infrequently as âfreehand attracting modeâ 2D applications Hard to get exact results Too much information, too difficult to work with for the most part Specify a bend utilizing a little number of âcontrol pointsâ Known as a spline bend or just spline

Interpolating Splines Specify focuses, the bend experiences every one of the focuses Seems most natural Surprisingly, not for the most part the best decision. Difficult to anticipate conduct Overshoots Wiggles Hard to get ânice-lookingâ bends

Approximating Splines âInfluencedâ by control focuses however not so much experience them. Different sorts & procedures Most regular: (Piecewise) Polynomial Functions Most normal of those: B Ã© zier B-spline Each has great properties Weâll concentrate on B Ã© zier splines

What is a bend, at any rate? We draw it, consider it a thing existing in space But scientifically we regard it as a capacity, x (t) Given an estimation of t , figures a point x Can think about the capacity as moving a point along the bend x (t) z x (0.0) x (0.5) x (1.0) y x

T he digression to the bend Vector focuses toward development (Length is the pace toward development) Also an element of t , x (t) z x â(0.0) x â(0.5) x â(1.0) y x

Polynomial Functions Linear: (1 st request) Quadratic: (2 nd request) Cubic: (3 rd request)

Point-esteemed Polynomials (Curves) Linear: (1 st request) Quadratic: (2 nd request) Cubic: (3 rd request) Each is 3 polynomials âin parallelâ: We as a rule characterize the bend for 0 â¤ t â¤ 1

How much do you have to indicate? Two focuses characterize a line (1 st request) Three focuses characterize a quadratic bend (2 nd request) Four focuses characterize a cubic bend (3 rd request) k+1 focuses characterize a k - request bend Letâs begin with a lineâ¦

Linear Interpolation Linear introduction , AKA Lerp Generates an esteem that is some place in the middle of two different qualities A âvalueâ could be a number, vector, shading, â¦ Consider interjecting between two focuses p 0 and p 1 by some parameter t This characterizes a âcurveâ that is straight. Otherwise known as a first-arrange spline When t=0 , we get p 0 When t=1 we get p 1 When t=0.5 we get the midpoint . p 1 t =1 . p 0 0< t <1 t =0

Linear interjection We can compose this in three ways All the very same mathematical statement Just diverse methods for taking a gander at it Different properties get to be evident

Linear introduction as weighted normal Each weight is an element of t The weights\' entirety is dependably 1, for any estimation of t Also known as mixing capacities

Linear insertion as polynomial Curve is based at point p 0 Add the vector, scaled by t . p 1 - p 0 . . p 0 .5( p 1 - p 0 )

Linear introduction in grid structure

Linear Interpolation: digression For a straight line, the digression is consistent

Outline throughout today Inverses of Transforms Curves review B Ã© zier bends

B Ã© zier Curves Can be considered as a higher request expansion of direct insertion p 1 p 1 p 2 p 1 p 3 p 0 p 0 p 0 p 2 Linear Quadratic Cubic

Cubic Bã©zier Curve Most normal case 4 focuses for a cubic Bã©zier Interpolates the endpoints Midpoints are âhandlesâ that control the digression at the endpoints Easy and instinctive to utilize Many demo applets online http://www.cs.unc.edu/~mantler/research/bezier/http://www.theparticle.com/applets/nyu/BezierApplet/http://www.sunsite.ubc.ca/LivingMathematics/V001N01/UBCExamples/Bezier/bezier.html Convex Hull property Variation-lessening property

Bã©zier Curve Formulation Ways to detail B Ã© zier bends, closely resembling direct : Weighted normal of control focuses - weights are Bernstein polynomials Cubic polynomial capacity of t Matrix frame Also, the de Casteljau calculation: recursive straight interjections Aside: Many of the first CG procedures were produced for Computer Aided Design and assembling. Before amusements, before films, CAD/CAM was the enormous application for CG. Pierre B Ã© zier worked for Peugot, created bends in 1962 Paul de Casteljau worked for Citroen, added to the bends in 1959

Bã©zier Curve Find the point x on the bend as a component of parameter t : p 1 â¢ x ( t ) p 0 p 2 p 3

de Casteljau Algorithm A recursive arrangement of straight insertions Works for any request. Weâll do cubic Not appallingly productive to assess along these lines Other structures all the more ordinarily utilized So why study it? Kinda flawless Intuition about the geometry Useful for subdivision (later today)

de Casteljau Algorithm Start with the control focuses And given an estimation of t In the drawings, tâ0.25 p 1 p 0 p 2 p 3

de Casteljau Algorithm p 1 q 1 q 0 p 0 p 2 q 2 p 3

de Casteljau Algorithm q 1 r 0 q 0 r 1 q 2

de Casteljau Algorithm r 0 â¢ x r 1

p 1 â¢ x p 0 p 2 p 3 de Casteljau algorihm Applets http://www2.mat.dtu.dk/individuals/J.Gravesen/cagd/decast.html http://www.caffeineowl.com/design/2d/vectorial/bezierintro.html

Recursive Linear Interpolation

Expand the Lerps

Weighted normal of control focuses Group this as a weighted normal of the focuses:

B Ã©zier utilizing Bernstein Polynomials Notice: Weights dependably add to 1 B 0 and B 3 go to 1 - interjecting the endpoints

General Bernstein Polynomials

General B Ã© zier utilizing Bernstein Polynomials Bernstein polynomial type of a n th-request Bã©zier bend:

p 3 p 1 p 0 p 2 Convex Hull Property Construct an arched polygon around an arrangement of focuses The raised frame of the control focuses Any weighted normal of the focuses, with the weights all somewhere around 0 and 1: Known as a curved blend of the focuses Result dependably exists in the curved structure (counting on the outskirt) Bã©zier bend is a raised mix of the control focuses Curve is constantly inside the raised body Very imperative property! Makes bend unsurprising Allows separating Allows crossing point testing Allows versatile tessellation

Cubic Equation Form Good for quick assessment: precompute steady coefficients ( a , b , c , d ) Doesnât give much geometric instinct But the geometry can be removed from the coefficients

Aside: direct mixes of focuses Reminder: we canât scale a point or include two focuses Can subtract two focuses Can take weighted normal of focuses if the weights mean one Act on homogeneous focuses: w part of result must be 1 Can likewise take weighted normal of focuses if the weights signify 0 The outcome gives w=0 , i.e. a vector E.g. p - q is the same as (+1) p + (- 1) q Can likewise do (- 1) p 0 +(3) p 1 +(- 3) p 2 +(1) p 3

Cubic Equation, vector documentation

Cubic Matrix Form Other cubic splines use distinctive premise framework B Hermite, Catmull-Rom, B-Spline, â¦

Cubic Matrix Form 3 parallel mathematical statements, in x, y and z:

M