#7: Cubic Bends.

Uploaded on:
Category: Medical / Health
#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:
Slide 1

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

Slide 2

Outline throughout today Inverses of Transforms Curves diagram B é zier bends

Slide 3

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

Slide 4

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

Slide 5

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

Slide 6

Inverse of a Scale by the inverses Easy to confirm:

Slide 7

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)

Slide 8

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

Slide 9

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

Slide 10

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

Slide 11

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

Slide 12

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

Slide 13

Outline throughout today Inverses of Transforms Curves review B é zier bends

Slide 14

Usefulness of bends in demonstrating Surface of unrest

Slide 15

Usefulness of bends in displaying Extruded/cleared surfaces

Slide 16

Usefulness of bends in demonstrating Surface patches

Slide 17

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

Slide 18

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

Slide 19

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

Slide 20

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

Slide 21

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

Slide 22

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

Slide 23

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

Slide 24

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

Slide 25

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

Slide 26

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…

Slide 27

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

Slide 28

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

Slide 29

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

Slide 30

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 )

Slide 31

Linear introduction in grid structure

Slide 32

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

Slide 33

Outline throughout today Inverses of Transforms Curves review B é zier bends

Slide 34

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

Slide 35

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

Slide 36

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

Slide 37

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

Slide 38

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)

Slide 39

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

Slide 40

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

Slide 41

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

Slide 42

de Casteljau Algorithm r 0 • x r 1

Slide 43

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

Slide 44

Recursive Linear Interpolation

Slide 45

Expand the Lerps

Slide 46

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

Slide 47

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

Slide 48

General Bernstein Polynomials

Slide 49

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

Slide 50

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

Slide 51

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

Slide 52

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

Slide 53

Cubic Equation, vector documentation

Slide 54

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

Slide 55

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

Slide 56


View more...