Αναλυτική µορφή καµπυλών (explicit representation)

Σχετικά έγγραφα
Καμπύλες και επιφάνειες

ΑΡΙΣΤΟΤΕΛΕΙΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΘΕΣΣΑΛΟΝΙΚΗΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΜΟΝΤΕΛΟΠΟΙΗΣΗ-ΨΗΦΙΑΚΗ ΣΥΝΘΕΣΗ ΕΙΚΟΝΩΝ Διδάσκων: Ν. ΝΙΚΟΛΑΙΔΗΣ

Approximation of distance between locations on earth given by latitude and longitude

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

Partial Differential Equations in Biology The boundary element method. March 26, 2013

Areas and Lengths in Polar Coordinates

Areas and Lengths in Polar Coordinates

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

Homework 3 Solutions

EE512: Error Control Coding

Parametrized Surfaces

Homework 8 Model Solution Section

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Γραφικά Υπολογιστών: Spline Αναπαραστάσεις

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

Matrices and Determinants

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Section 8.3 Trigonometric Equations

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Math221: HW# 1 solutions

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

Numerical Analysis FMN011

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

derivation of the Laplacian from rectangular to spherical coordinates

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Fractional Colorings and Zykov Products of graphs

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

1. (a) (5 points) Find the unit tangent and unit normal vectors T and N to the curve. r(t) = 3cost, 4t, 3sint

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

ΕΙΣΑΓΩΓΗ ΣΤΗ ΣΤΑΤΙΣΤΙΚΗ ΑΝΑΛΥΣΗ

PARTIAL NOTES for 6.1 Trigonometric Identities

( y) Partial Differential Equations

2 Composition. Invertible Mappings

The Simply Typed Lambda Calculus

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

Pg The perimeter is P = 3x The area of a triangle is. where b is the base, h is the height. In our case b = x, then the area is

Example Sheet 3 Solutions

Problem Set 9 Solutions. θ + 1. θ 2 + cotθ ( ) sinθ e iφ is an eigenfunction of the ˆ L 2 operator. / θ 2. φ 2. sin 2 θ φ 2. ( ) = e iφ. = e iφ cosθ.

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Reminders: linear functions

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Inverse trigonometric functions & General Solution of Trigonometric Equations

2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits.

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ. Ψηφιακή Οικονομία. Διάλεξη 7η: Consumer Behavior Mαρίνα Μπιτσάκη Τμήμα Επιστήμης Υπολογιστών

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

Second Order Partial Differential Equations

Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1

C.S. 430 Assignment 6, Sample Solutions

( ) 2 and compare to M.

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

TMA4115 Matematikk 3

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Section 9.2 Polar Equations and Graphs

Other Test Constructions: Likelihood Ratio & Bayes Tests

ST5224: Advanced Statistical Theory II

Solutions to Exercise Sheet 5

Math 6 SL Probability Distributions Practice Test Mark Scheme

1 String with massive end-points

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

The challenges of non-stable predicates

Integrals in cylindrical, spherical coordinates (Sect. 15.7)

Mock Exam 7. 1 Hong Kong Educational Publishing Company. Section A 1. Reference: HKDSE Math M Q2 (a) (1 + kx) n 1M + 1A = (1) =

Bayesian statistics. DS GA 1002 Probability and Statistics for Data Science.

Local Approximation with Kernels

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Statistical Inference I Locally most powerful tests

1) Formulation of the Problem as a Linear Programming Model

Srednicki Chapter 55

Variational Wavefunction for the Helium Atom

Calculating the propagation delay of coaxial cable

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

6.3 Forecasting ARMA processes

D Alembert s Solution to the Wave Equation

Second Order RLC Filters

Concrete Mathematics Exercises from 30 September 2016

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

Differential equations

Assalamu `alaikum wr. wb.

Instruction Execution Times

Figure A.2: MPC and MPCP Age Profiles (estimating ρ, ρ = 2, φ = 0.03)..

the total number of electrons passing through the lamp.

Section 7.6 Double and Half Angle Formulas

The Spiral of Theodorus, Numerical Analysis, and Special Functions

1. Ηλεκτρικό μαύρο κουτί: Αισθητήρας μετατόπισης με βάση τη χωρητικότητα

[1] P Q. Fig. 3.1

Solutions to the Schrodinger equation atomic orbitals. Ψ 1 s Ψ 2 s Ψ 2 px Ψ 2 py Ψ 2 pz

Block Ciphers Modes. Ramki Thurimella

Finite Field Problems: Solutions

DERIVATION OF MILES EQUATION FOR AN APPLIED FORCE Revision C

ECE 468: Digital Image Processing. Lecture 8

New bounds for spherical two-distance sets and equiangular lines

CHAPTER 101 FOURIER SERIES FOR PERIODIC FUNCTIONS OF PERIOD

Arithmetical applications of lagrangian interpolation. Tanguy Rivoal. Institut Fourier CNRS and Université de Grenoble 1

Transcript:

Αναλυτική µορφή καµπυλών (explicit representation) 2 διαστάσεις: έκφραση της εξαρτηµένης µεταβλητής ως προς την ανεξάρτητη y=f(x), Μια τέτοια έκφραση µπορεί να µην υπάρχει για συγκεκριµένη καµπύλη Ευθεία y=mx+h, δεν καλύπτει κάθετες ευθείες Κύκλος: 2 y = ± r x 2,0 x r

Αναλυτική µορφή καµπυλών (explicit representation) 3 διαστάσεις: Καµπύλες: y=f(x), z=g(x)

Πεπλεγµένη µορφή καµπυλών (implicit representation) Καµπύλη σε 2 διαστάσεις: f(x,y)=0 ax+by+c=0, x 2 +y 2 -r=0 Συναρτήσεις αυτής της µορφής είναι συναρτήσεις ελέγχου ιδιότητας µέλους (membership functions) Η πεπλεγµένη µορφή δεν είναι εύχρηστη υσκολία στο να δηµιουργήσουµε σηµεία της καµπύλης/επιφάνειας.

Παραµετρική µορφή καµπυλών (parametric representation) Καµπύλες στις 3 διαστάσεις x=x(u), y=y(u), z=z(u) p(u)=[x(u), y(u), z(u)] T ιάνυσµα εφαπτόµενο στην καµπύλη. dp( u) dx( u) dy( u) dz( u) T = du du du du

Παραµετρική µορφή καµπυλών (parametric representation)

Πολυωνυµικές παραµετρικές καµπύλες Θα χρησιµοποιήσουµε µορφές µε πολυώνυµα ως προς το u (καµπύλες). Πολυωνυµική παραµετρική καµπύλη βαθµού n 3(n+1) βαθµούς ελευθερίας p( u) c = n k = 0 u k xk yk zk k c = c c c k

Πολυωνυµικές παραµετρικές καµπύλες Τρεις ανεξάρτητες εξισώσεις µε n+1 βαθµούς ελευθερίας (µεταβλητές) η καθεµία: n pu ( ) = k = 0 k uck Θεωρούµε 0<=u<=1 για τµήµα καµπύλης

Επιθυµητές Ιδιότητες Συνέχεια Μικρή πολυπλοκότητα στους υπολογισµούς Ευελιξία Local control

Συνέχεια Μικρές µεταβολές της παραµέτρου οδηγούν σε µικρές µεταβολές της τιµής της συνάρτησης Zeroth-order continuity C 0 : continuity of values of the curve 1st order continuity C 1 : continuity of the first derivative, i.e. tangential continuity 2nd order continuity C 2 : continuity of the second derivative

Μας ενδιαφέρουν συνήθως οµαλές, συνεχείς καµπύλες Στις πολυωνυµικές καµπύλες υπάρχουν όλες οι παράγωγοι και µπορούν να υπολογιστούν αναλυτικά. Οι πολυωνυµικές καµπύλες είναι infinite order continuous

Κατασκευή της συνολικής καµπύλης µε συνένωση µικρών τµηµάτων Τοπικός έλεγχος του σχήµατος, απαραίτητος για την αλληλεπιδραστική κατασκευή καµπύλης Τα µόνα σηµεία όπου µπορεί να υπάρξει ασυνέχεια είναι στις ενώσεις 2 καµπυλών. Στο animation αρκεί συνήθως C 1

Χρήση σηµείων ελέγχου (control, data points) για τον προσδιορισµό του σχήµατος της καµπύλης Μεταβολή των σηµείων ελέγχου για µεταβολή του σχήµατος της καµπύλης.

Πιθανή επιλογή: η καµπύλη να περνάει από κάποια σηµεία ελέγχου και κοντά από κάποια άλλα.

Κυβικές παραµετρικές καµπύλες (parametric cubic polynomial curves) ιάφορα είδη καµπυλών ανάλογα µε το πώς δίνουµε τις προδιαγραφές (σηµεία ελέγχου) για συγκεκριµένες τιµές της παραµέτρου u. Η καµπύλη να περνάει από τα σηµεία ελέγχου για συγκεκριµένες τιµές του u (interpolation) Η καµπύλη να έχει συγκεκριµένες τιµές παραγώγων σε συγκεκριµένες τιµές του u Συνθήκες συνέχειας στα σηµεία ένωσης δύο τµηµάτων Η καµπύλη να περνάει κοντά από κάποια σηµεία ελέγχου (approximation)

Κυβικές παραµετρικές καµπύλες (parametric cubic polynomial curves) Επιλογή βαθµού Πολυωνυµικές καµπύλες υψηλού βαθµού Πολλές ελεύθερες παράµετροι -µεγαλύτερη ευελιξία στον προσδιορισµό του σχήµατος Υψηλό κόστος για τον υπολογισµό των σηµείων της καµπύλης. Οι καµπύλες µπορεί να µην είναι πολύ οµαλές

Κυβικές παραµετρικές καµπύλες (parametric cubic polynomial curves) Πολυωνυµικές καµπύλες µικρού βαθµού Λιγότερες ελεύθερες παράµετροι -µικρότερη ευελιξία στον προσδιορισµό του σχήµατος Πιο οµαλές καµπύλες Χρήση κυβικών πολυωνυµικών καµπυλών.

Κυβικές παραµετρικές καµπύλες (parametric cubic polynomial curves) k T p( u) = c + cu+ c u + c u = c u = u c 2 3 0 1 2 3 [ ] c= c c c c u c 0 1 2 3 2 3 T = 1 u u u = c c c k kx ky kz T Ο πίνακας c (12x1) περιέχει όλες τις παραµέτρους που θα πρέπει να προσδιορίσουµε T 3 k = 0 k

Κυβικές παραµετρικές καµπύλες (parametric cubic polynomial curves) Οχρήστης καθορίζει τα σηµεία ελέγχου και από αυτά προσδιορίζονται οι παράµετροι c της καµπύλης. Χρειάζοµαι 12 ανεξάρτητες εξισώσεις Τέσσερα συστήµατα εξισώσεων µε 3 εξισώσεις το καθένα (ένα για κάθε συντεταγµένη)

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής Κυβικές καµπύλες που περνάνε από δοσµένα σηµεία Χρησιµοποιούνται σπάνια στην πράξη Χρήσιµα για τον καθορισµό της µεθοδολογίας. Τέσσερα σηµεία ελέγχου p 0, p 1, p 2, p 3 p k x y k = k z k

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής Ψάχνουµε τις τιµές των παραµέτρων στο c ώστε η καµπύλη p(u)=u T c να περνάει από τα p ι σε ισαπέχουσες τιµές του u: 0, 1/3, 2/3, 1

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής p = p(0) = c 0 0 2 3 1 1 1 1 p = p( ) = c + c + c + c 3 3 3 3 1 0 1 2 3 2 3 2 2 2 2 p = p( ) = c + c + c + c 3 3 3 3 p = p(1) = c + c + c + c 2 0 1 2 3 3 0 1 2 3

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής p = Ac [ ] p= p p p p 0 1 2 3 1 0 0 0 2 3 1 1 1 1 3 3 3 A = 2 3 2 2 2 1 3 3 3 1 1 1 1 T

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής εν έχουµε τις τυπικές πράξεις πινάκων! Τα p, c θεωρούνται διανύσµατα στήλης 4x1 µε κάθε στοιχείο τους ένα διάνυσµα στήλης 3x1 Πολλαπλασιασµός ενός στοιχείου του A µε ένα στοιχείο των p, c : γινόµενο διανύσµατος στήλης µε βαθµωτό µέγεθος

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής Ο Α αντιστρέψιµος, ο αντίστροφος του είναι ο interpolating geometry matrix M I 1 0 0 0 5.5 9 4.5 1 1 = A = 9 22.5 18 4.5 4.5 13.5 13.5 4.5 c=m I p εύρεση των συντελεστών της καµπύλης.

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής Αν έχουµε m σηµεία ελέγχου απ όπου θέλουµε να περνάει η καµπύλη: Χρήση κυβικών καµπυλών σε τετράδες σηµείων, µερικά επικαλυπτόµενων (p o, p 1, p 2, p 3 ), (p 3, p 4, p 5, p 6 ), Ο ίδιος πίνακας M I για όλες τις καµπύλες εν έχω συνέχεια παραγώγων στα συνδετικά σηµεία.

Κυβικά πολυώνυµα (καµπύλες) παρεµβολής

Πολυώνυµα ανάµειξης (blending polynomials) T T T p( u) = u c= u M p= b( u) p b( u) b0 ( u) b( u) T 1 = MI u= b2 ( u) I b3 ( u)

Πολυώνυµα ανάµειξης (blending polynomials) p( u) = b ( u) p + b( u) p + b ( u) p + b ( u) p 0 0 1 1 2 2 3 3

Πολυώνυµα ανάµειξης (blending polynomials) Μπορούµε να δούµε την επίδραση των σηµείων ελέγχου στα σηµεία της καµπύλης Απλή περίπτωση: γραµµική παρεµβολή µεταξύ δύο σηµείων p( u) = b ( u) p + b( u) p b ( u) = (1 u) 0 b( u) 1 = u 0 0 1 1 Ισοδύναµη θεώρηση: τα σηµεία ελέγχου βαρύνουν τα πολυώνυµα ανάµειξης.

Καµπύλες Hermite Απαιτούµε από την καµπύλη να περνάει µόνο από δύο σηµεία ελέγχου p 0, p 3 (αρχή και τέλος) p = p(0) = c 0 0 p = p(1) = c + c + c + c 3 0 1 2 3 Απαιτούµε από την καµπύλη να έχει συγκεκριµένη κλίση (παράγωγο) στα p 0, p 3

Καµπύλες Hermite dx du dy p'( u) = = c + 2uc + 3u c du dz du p' = p'(0) = c 0 1 2 1 2 3 p' = p'(1) = c + 2c + 3c 3 1 2 3 4 τριάδες εξισώσεων για τον προσδιορισµό των παραµέτρων c

Καµπύλες Hermite ίνω 2 σηµεία και δύο διανύσµατα κλίσης (π.χ. µε γραφικό τρόπο)

Καµπύλες Hermite p0 1 0 0 0 3 1 1 1 1 p q= = c p ' 0 1 0 0 0 p ' 3 0 1 2 3 c= M q M H H 1 0 0 0 0 0 1 0 = 3 3 2 1 2 2 1 1

Καµπύλες Hermite Στα σηµεία σύνδεσης δύο τµηµάτων µπορώ να απαιτήσω ίδιες τιµές των συναρτήσεων και των παραγώγων

Συνέχεια ύο καµπύλα τµήµατα που προσδιορίζονται από τα πολυώνυµα p(u) q(u) Εφαρµόζουµε διάφορες συνθήκες συνέχειας εξισώνοντας τιµές των πολυωνύµων ή των παραγώγων στο u=1 για το p(u) και το u=0 για το q(u)

Συνέχεια Συνέχεια των τιµών της συνάρτησης, C 0 παραµετρική συνέχεια px(1) qx(0) p(1) = py(1) (0) qy(0) = q = pz(1) qz(0) Συνέχεια των παραγώγων, C 1 παραµετρική συνέχεια p'(1) x q'(0) x p'(1) = p' y(1) '(0) q' y(0) = q = p'(1) z q'(0) z Κάθε σχέση είναι 3 συνθήκες

Συνέχεια Χαλαρότερη συνθήκη: οι παράγωγοι (εφαπτόµενα διανύσµατα) να είναι ανάλογες p (1)=aq (0) για κάποιο θετικό a Ίδια διεύθυνση, διαφορετικό µέτρο. G 1 γεωµετρική συνέχεια. Επέκταση C n G n

Συνέχεια Η διαφορά στο µέγεθος των εφαπτοµενικών διανυσµάτων παίζει ρόλο. Σε αρκετές περιπτώσεις (καµπύλες κίνησης σε animation) η G 1 συνέχεια δεν είναι αρκετή.

Καµπύλες Bezier Απαιτούµε και πάλι από την καµπύλη να περνάει από δύο σηµεία ελέγχου p 0, p 3 (αρχή και τέλος) p = p(0) = c 0 0 p = p(1) = c + c + c + c 3 0 1 2 3 Απαιτούµε από την καµπύλη να έχει συγκεκριµένη κλίση (διανυσµατική παράγωγο) στα p 0, p 3

Καµπύλες Bezier ιαφορά από καµπύλες Hermite: Η παράγωγος στα p 0, p 3 δίνεται µε βάση δύο άλλα σηµεία ελέγχου p 1, p 2 p1 p0 p '(0) = 1/3 p3 p2 p '(1) = 1/3 3( p p ) = c 1 0 3( p p ) = c + 2c + 3c 3 2 1 1 2 3

Καµπύλες Bezier

Καµπύλες Bezier c= M p B T p( u) = u M p B Bezier geometry matrix M B 1 0 0 0 3 3 0 0 = 3 6 3 0 1 3 3 1

Καµπύλες Bezier Ηκαµπύλη βρίσκεται µέσα στο convex hull των σηµείων ελέγχου Παρόλο που δεν περνάει από τα p 1, p 2 βρίσκεται κοντά σε αυτά.

Καµπύλες Bezier Για m σηµεία ελέγχου χρήση καµπυλών Bezier σε τετράδες σηµείων, µερικά επικαλυπτόµενων (p o, p 1, p 2, p 3 ), (p 3, p 4, p 5, p 6 ), Έχω C 0 συνέχεια αλλά όχι C 1 συνέχεια Για συνέχεια παραγώγων πρέπει τα p 2, p 4 συνευθειακά και να ορίζουν διανύσµατα µε ίδιο µέτρο.

Καµπύλες Bezier Το γεγονός αυτό σε συνδυασµό µε το ότι δίνω σηµεία ελέγχου κάνουν τις καµπύλες Bezier κατάλληλες για διαδραστική σχεδίαση.

Υπολογισµός καµπυλών Bezier κατά De Casteljau Υπολογισµός της τιµής της καµπύλης για συγκεκριµένο u χωρίς να χρησιµοποιήσουµε τις εξισώσεις ορισµού. Γεωµετρική κατασκευή

Cubic B-splines Οι καµπύλες Bezier έχουν C 0 συνέχεια στα σηµεία των ενώσεων. Για συνέχεια στα σηµεία αυτά δεν απαιτούµε από τις καµπύλες/επιφάνειες να περάσουν από τα σηµεία ελέγχου αλλά απλά να τα προσεγγίσουν. Εκµεταλλευόµαστε τις χαλαρές απαιτήσεις στα σηµεία ελέγχου για να πετύχουµε συνέχεια στα σηµεία των ενώσεων.

Cubic B-spline καµπύλες Θα µελετήσουµε συγκεκριµένο τύπο κυβικής B-spline καµπύλης (uniform cubic B-spline) Τετράδα σηµείων ελέγχου, [p i-2, p i-1, p i, p i+1 ] µέσα σε ένα µεγαλύτερο σύνολο σηµείων Καθώς η παράµετρος u µεταβάλλεται µεταξύ 0 και 1 η καµπύλη διατρέχει το διάστηµα µεταξύ p i-1, p i, χωρίς να περνάει από αυτά.

Cubic B-spline καµπύλες Όµοια για το [p i-3, p i-2, p i-1, p i ] όπου η καµπύλη κινείται µεταξύ των p i-2, p i-1 Οι τετράδες σηµείων ελέγχου έχουν επικάλυψη 3 σηµεία και η καµπύλη κινείται µεταξύ των δύο µεσαίων. Έστω p(u) η καµπύλη µεταξύ των p i-1, p i και q(u) µεταξύ των p i-2, p i-1

Cubic B-spline καµπύλες Συνθήκες µεταξύ των p(0) και q(1) αλλά και µεταξύ του p(1) και της αρχής της στα δεξιά καµπύλης. 2 1 1 ( ) T i i i i u + = = p u Mp p p p p p 3 2 1 ( ) T i i i i u = = q u Mq p p q p p

Cubic B-spline καµπύλες Χρήση διαφόρων ειδών συνθηκών. 1 p(0) = q(1) = ( pi 2 + 4 pi 1+ pi) 6 1 p'(0) = q'(1) = ( pi pi 2) 2

Cubic B-spline καµπύλες p(u)=u T c 1 c0 = ( pi 2 + 4 pi 1+ pi ) 6 1 c1 = ( pi pi 2 ) 2 Αντίστοιχες συνθήκες για το p(1) 1 p(1) = c0 + c1+ c2 + c3 = ( pi 1+ 4 pi + pi+ 1) 6 1 p'(1) = c1 + 2c2 + 3 c3 = ( pi+ 1 pi 1) 2

Cubic B-spline καµπύλες Β-spline geometry matrix M S 1 4 1 0 1 3 0 3 0 = 6 3 6 3 0 1 3 3 1

Cubic B-spline καµπύλες Ηκαµπύλη περιέχεται στο convex hull των τεσσάρων σηµείων ελέγχου, αλλά δεν καλύπτει όλη του την έκταση

Cubic B-spline καµπύλες Επιβάλλαµε C 1 συνέχεια στα άκρα αλλά στην πραγµατικότητα η καµπύλη είναι C 2 συνεχής Τρεις φορές η δουλειά που απαιτείται για τις καµπύλες Bezier ή τις καµπύλες παρεµβολής. Στα splines η επικάλυψη είναι 3 σηµεία ελέγχου ενώ στις άλλες καµπύλες µόνο ένα. Για κάθε καινούργιο σηµείο ελέγχου έχω να υπολογίσω τις παραµέτρους µιας νέας καµπύλης Στα άλλα είδη καµπύλών νέα καµπύλη για κάθε 3 νέα σηµεία ελέγχου.

Cubic B-spline καµπύλες Κάθε σηµείο ελέγχου επιδρά σε 4 γειτονικά τµήµατα της καµπύλης (τοπικότητα) Θεωρώ ότι η παράµετρος u είναι συνεχής στα διαδοχικά διαστήµατα. 0 3 2 0 u< i 2 b ( u+ 2) i 2 u< i 1 b1 ( u+ 1) i 1 u< i Bi ( u) = { b ( u) i u < i+ 1 b ( u 1) i+ 1 u< i+ 2 0 u i+ 2

Cubic B-spline καµπύλες Συνάρτηση βάσης Σχηµατίζεται από σύνθεση τεσσάρων µετατοπισµένων πολυωνύµων ανάµειξης

Cubic B-spline καµπύλες Η συνολική καµπύλη που ορίζεται από τα σηµεία ελέγχου p 0, p 1,... p i,... p m δίνεται από το γραµµικό συνδυασµό µετατοπισµένων συναρτήσεων βάσης, κάθε µία κεντραρισµένη στο u=i και µη µηδενική σε διάστηµα µήκους 4 m 1 p( u) = Bi( u) p i= 1 i

Cubic B-spline καµπύλες

Catmull-Rom Splines Derived from Hermite, but tangents defined by control points themselves: p i t i p i-1 p i+1 Q i (u) = U M C P = [u 3 u 2 u1] -1 3-3 1 2-5 4-1 -1 0 1 0 0 2 0 0 p i-1 p i p i+1 p i+2

Kochanek-Bartels Splines Tension, Bias, Discontinuity (modified CR splines) Tension Bias Discontinuity

Controlling the motion along the curve Designing the shape of the interpolation curve is just the first step. P(u)=(x(u), y(u), z(u)): space curve The speed with which the curve is traced should also be controlled. Varying the curve parameter u in equal intervals does not correspond to equidistant points on the curve

Arc length re-parameterization As a first step to controlling the motion the curve should be parameterized by arc length s. Find relation between u & s s=g(u) u=g -1 (s) (if possible) P(u)=P(G -1 (s)) =(x(s), y(s), z(s)) After that the animator can easily control the speed by specifying s=h(t) distance-time curve

Space curve specifies where to go Distance-time curve specifies when to go P(u)=P(G -1 (s)) = P(G -1 (h(t)))=(x(t), y(t), z(t))

Arc length re-parameterization Problems to be solved for parameterization Given u 1 u 2 find Length(u 1, u 2 ) Given 0, u 2 find s=length(0, u 2 ) Essentially find s=g(u) Given a length s and u 1 find u 2 so that Length(u 1, u 2 )=s Given a length s find u 2 so that Length(0, u 2 )=s Essentially: find u=g -1 (s) Usually no analytic solution, use numerical solutions.

Estimating arc length by forward differencing Sample the curve at multiple, evenly spaced values of u, u i Approximate length between adjacent values u i, u i+1 using linear (Euclidean) distance Build table G(u) (indexed by evenly spaced values of u) Essentially: find s=g(u) in tabular form

u are equally spaced, s are NOT

Estimating arc length by forward differencing i=0 Length(0)=G(0)=0 i=1 Length(1)= G(0.05)=distance(P(0), P(0.05)) i=2 Length(2)= G(0.10)= G(0.05)+distance(P(0.05), P(0.10)) Example: find length s from u=0 to u s =0.73 i=(int)(u/du)=int(0.73/0.05)=14 S=Length(i)+(Length(i+1) -Length(i) )*(u s - value(i))/(value(i+1)-value(i))

Estimating arc length by forward differencing find Length(u 1, u 2 ): follow the procedure above twice and subtract the two lengths Given a length s find u 2 so that Length(0, u 2 )=s Essentially: find u=g -1 (s) Search s values for values closest to s i and then interpolate s values are not equally spaced but are increasing monotonically: use binary search.

Estimating arc length by forward differencing Given a length s and u 1 find u 2 so that Length(u 1, u 2 )=s Use table to approximate length s(u 1 ) that corresponds to u 1, add value s(u 1 ) to s, use the previous approach to evaluate u 2 Simple approach, two sources of error Approximations used to build the table Arc length between two points evaluated as their Euclidean distance. Interpolation used to find the desired value, once the table has been built.

Estimating arc length by forward differencing Approximations used to build the table Supersample the curve: While building a 1000 entries table evaluate each interval using 10 points (supersample to 10000 points) Interpolation used to find the desired value, once the table has been built. Use higher order interpolation than linear interpolation

Estimating arc length by forward differencing Adaptive approach to building the table Use more dense samples where needed, adaptive subdivision Put u=0, s=0 on the table Evaluate P(u max ), C=distance(0, P(u max )) Evaluate P(u max /2), A=distance(0, P(u max /2)), B=distance(P(u max /2), P(u max )) If A+B-C<thres put (u max /2, A), (u max, A+B) Else send the two halves for subdivision

Analytical approach

Analytical approach Integral cannot be evaluated analytically!!

Numerical integration Use numerical integration techniques to evaluate the arc length integral (distance between two u values on the curve), instead of linear distance between two points Trapezoidal integration

Numerical integration Simpson s integration Gaussian quadrature (nonuniformly spaced sample points

Numerical integration Adaptive Gaussian integration Length of an interval is evaluated using Gaussian quadrature Interval is halved and length of each half is evaluated using Gaussian quadrature If results are significantly different, the two halves are further subdivided.

Speed control We have P(s) (space curve) Final result of speed control: a function s=h(t) (distance-time function) Usually s, t normalized to [0,1] Specify t, obtain s=h(t), find position on the curve P(h(t)). Tracing the curve at equal spaced intervals of arc length creates constant speed motion s=h(t)=v*t : linear function (speed=v)

Speed control Having a separate space curve P(u) (parameterized by arclength) and a distancetime curve allows the animator to apply the same style of motion on different space curves

Specification of distance-time function Analytically or graphically specify s=h(t) Analytically or graphically specify v=f(t) Integrate to obtain s=h(t) Analytically or graphically specify a=g(t) and integrate to specify v=f(t)

Specification of distance-time function Frequent assumptions while building s=h(t) It is monotonic in t :we are moving only forward along the curve It is continuous: there are no jumps in position. The entire curve is to be traversed in the given time s(0)=0; s(1)=1

Ease-in ease-out Start/end the motion with zero speed Zero derivative of distance-time curve at start/end Accelerate in the beginning of motion, decelerate in the end of the motion Use sinusoid functions or combination of sinusoid and linear functions to specify easein ease-out.

The velocity changes continuously

When working with acceleration-time curves the fact that the object should start/end traversal with zero speed, creates constraints. Area below acceleration-time curve should be zero

When working with velocity-time curves the fact that the total distance (usually normalized to 1) should be traveled within the given time (usually normalized to 1), creates constraints. Area below velocity-time curve (total distance) should be one

The user specifies the curve graphically and the curve floats up or down to comply to the constraint The user cannot set implicitly specific velocity values The user sets graphically desired velocities at certain time instances and the shape of the curve changes so that the constraint is satisfied Might result in undesired curve shapes.

Object deformation Physically based approaches Deform an object by applying forces Interactive approaches Animator/modeler specifies interactively the deformations

Object warping Animator/modeler displaces a vertex or group of vertices The displacement propagates (attenuated) to adjacent vertices (up to a certain extent). Attenuation is a function of distance between two vertices Minimum number of edges connecting the two vertices Minimum distance between the two vertices

Object warping Attenuation comes in the form of distancedependent scaling factor applied to the displacement vector

Nonlinear Global Deformation

Nonlinear Global Deformation

Nonlinear Global Deformation Good for modeling [Barr 87] Animation is harder

Free Form Deformation (FFD) Deform space by deforming a lattice around an object The deformation is defined by moving the control points Imagine it as if the object were encased in rubber

2-D Free Form Deformation (FFD) Construct a local coordinate system (2-D grid) to place the object. Grid initially orthogonal, aligned with the global axes Transformation from local to global coordinates is just a translation and (possibly) a scaling Grid is distorted by moving its vertices (space distortion)

2-D Free Form Deformation (FFD) The object vertices are relocated by bilinear interpolation relative to the cell of the grid where it is located 1974 film Hunger

Polyline Deformation Draw a piecewise linear line (polyline) through the geometry For each vertex compute Closest polyline segment Distance to segment Relative distance along this segment Deform polyline and recompute vertex positions

Trilinear Interpolation Let S, T, and U (with origin P 0 ) define local coordinate axes of bounding box that encloses geometry A vertex, P s, coordinates are: U T S P P T S u T S U P P S U t S U T P P U T s = = = ) ( ) ( ) ( ) ( ) ( ) ( 0 0 0

Volumetric Control Points Each of S, T, and U axes are subdivided by control points A lattice of control points is constructed Bezier interpolation of moved control points define new vertex positions = + + + = + + + = = = = ijk k k n n k j j m m j i i l l i ijk P u u k n t t j m s s i l u t s P U n k T m j S l i P P U u T t S s P P ) (1 ) (1 ) (1 ),, ( 0 0 0 0 0

Free Form Deformation (FFD) The lattice defines a Bezier volume Q( u, v, w) = pijk B( u) B( v) B( w) ijk Compute lattice coordinates ( u, v, w) Alter the control points p ijk Compute the deformed points Q( u, v, w) ( u, v, w) ( u, v, w)

FFD Example

FFD Example

Compositing of FFDs Sequential composition Hierarchical composition

Using FFDs to Animate Build control point lattice that is smaller than geometry Move lattice through geometry so it affects different regions in sequence Animate mouse under the rug, or subdermals (alien under your skin), etc.

Using FFDs to Animate Build FFD lattice that is larger than geometry Translate geometry within lattice so new deformations affect it with each move Change shape of object to move along a path

Animating the FFD Create interface for efficient manipulation of lattice control points over time Connect lattices to rigid limbs of human skeleton Physically simulate control points

FFD Animation Animate a reference and a deformed lattice reference deformed morphed

FFD Animation Animate the object through the lattice reference deformed morphed