Computer Graphcs Geometrc Modelg Geometrc Modelg A Example 4 Outle Objectve: Develop methods ad algorthms to mathematcally model shape of real world objects Categores: Wre-Frame Represetato Object s represeted as as a set of pots ad edges (a graph) cotag topologcal formato. Used for fast dsplay teractve systems. Ca be ambguous: Wre-frame represetatos Boudary represetatos Volumetrc represetatos 5 6 Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo
Computer Graphcs Geometrc Modelg Volumetrc Represetato Voxel based Advatages: smple ad robust Boolea operatos, /out tests, ca represet ad model the teror of the object. Dsadvatages: memory cosumg, o-smooth, dffcult to mapulate. Costructve Sold Geometry Use set of volumetrc prmtves Box, sphere, cylder, coe, etc For costructg complex objects use Boolea operatos Uo Itersecto Subtracto Complemet 7 8 CSG Trees Freeform Represetato Operatos performed recursvely Fal object stored as sequece (tree) of operatos o prmtves Commo CAD packages mechacal parts ft well to prmtve based framework Ca be exteded wth free-form prmtves S S C S S B S B + C B C B C Explct form: z z(x, y) Explct s a specal case of Implct form: f(x, y, z) mplct ad parametrc form Parametrc form: S(u, [x(u,, y(u,, z(u, ] Example org cetered sphere of radus R: Explct : z + R x y z R x y Implct : x + y + z R Parametrc : ( x, y, z) ( R cosθ cosψ, Rsθ cosψ, Rsψ ), θ [,π ], ψ [ π π, ] 9 Parametrc Curves Aalogous to trajectory of partcle space. Sgle parameter t [T,T ] lke tme. posto p(t) (x(t),y(t)), velocty v(t) (x (t),y (t)) Crcle: x(t) cos(t), y(t) s(t) t [,π) v(t) x(t) cos(t), y(t) s(t) t [,π) v(t) x(t) (-t )/(+t ), y(t) t/(+t ) t (-,+ ) v(t) (x (t),y (t),y (t))(t)) (x(t),y(t)) k(t) /r(t) (x(t),y(t)) r(t) Mathematcal Cotuty C (t) & C (t), t [,] - parametrc curves Level of cotuty of the curves at C () ad C () s: C - :C () C () (dscotuous) C : C () C () (postoal cotuty) C k, k > : cotuous up to k th dervatve ( j) C ( j) () C (), j k Cotuty of sgle curve sde ts parameter doma s smlarly defed - for polyomal bases t s C Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo
Computer Graphcs Geometrc Modelg Geometrc Cotuty Mathematcal cotuty s sometmes too strog May be relaxed to geometrc cotuty (so curves would look the same, but eed to chage ther parameterzato) G k, k : Same as C k G k, k : C' () α C' () G k, k : There s a reparameterzato of C (t) & C (t), where the two are C k E.g. C C (t)[cos(t),s(t)], t [ π/,], C C (t)[cos(t),s(t)], t [,π/] C (t)[cos(t),s(t)], t [,π/4] C (t) & C (t) are C (& G ) cotuous C C (t) & C (t) are G cotuous (ot C ) Polyomal Bases Moomal bass {, x, x, x, } Coeffcets are geometrcally meagless Mapulato s ot robust Number of coeffcets polyomal rak We seek coeffcets wth geometrcally tutve meags Polyomals are easy to aalyze, dervatves rema polyomal, etc. Other polyomal bases (wth better geometrc tuto): Lagrage (Iterpolato scheme) Hermte (Iterpolato scheme) Bezer (Approxmato scheme) B-Sple (Approxmato scheme) 4 Cubc Hermte Bass Set of polyomals of degree k s lear vector space of degree k+ The caocal, moomal bass for polyomals s {, x, x, x, } Defe geometrcally-oreted bass for cubc polyomals Has to satsfy: h,j (t):, j,, t [,] Physcal Sples 5 6 Hermte Cubc Bass The four cubcs whch satsfy these codtos are h t (t ) + h t( t ) Obtaed by solvg four lear equatos four ukows for each bass fucto Prove: Hermte cubc polyomals are learly depedet ad form a bass for cubcs h t (t ) h t ( t ) Hermte Cubc Bass (cot d) Lets solve for h (t) as a example. h (t) a t + b t + c t + d must satsfy the followg four costrats: h () d, h () a + b + c + d, Four lear equatos four ukows. h '() c, h '() a + b + c. 7 8 Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo
Computer Graphcs Geometrc Modelg Hermte Cubc Bass (cot d) Let C(t) be a cubc polyomal defed as the lear combato: C t) P h + Ph + T h + T h ( ) ( t Parametrc Sples Ft sple depedetly for x(t) ad y(t) to obta C(t) The C() P, C() P, C () T, C () T To geerate a curve through P & P wth slopes T & T, use C t) P h + Ph + T h + T h ( ) ( t 9 Cubc Sples Stadard sple put set of pots {P }, No dervatves specfed as put Iterpolate by cubc segmets (4 DOF): Derve {T },.., from C cotuty costrats Solve 4 lear equatos 4 ukows Iterpolato ( equatos): C ( ) P C ( ) P,.., C cotuty costrats ( equatos): ' C ( ) C ( ),.., ' + C cotuty costrats ( equatos): '' C ( ) C ( ),.., '' + Cubc Sples Have two degrees of freedom left (to reach 4 DOF) Optos Natural ed codtos: C ''(), C ''() Complete ed codtos: C '(), C '() Prescrbed ed codtos (dervatves avalable at the eds): C '() T, C '() T Perodc ed codtos C '() C '(), C ''() C ''(), atural prescrbed Questo: What parts of C(t) are affected as a result of a chage P? Bezer curve s a approxmato of gve cotrol pots Deote by γ (t): t [,] Bezer curve of degree s defed over + cotrol pots {P }, Bezer Curves P P P 5 P γ(t) De Casteljau Costructo Select t [,] value. The, For : to do P For j : to do For : j to do P [ j] [ γ : P [ : ( t) P ] ; [] : P; j ] [ + tp j ] ; γ (t) P P P 4 P P t / γ (/) 4 Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo
Computer Graphcs Geometrc Modelg Algebrac Form of Bezer Curves Bezer curve for set of cotrol pots {P }, : γ PB P! ( t) t!( )! where {B (t)}, Berste bass of polyomal of degree Cubc case: 5 6 Algebrac Form of Bezer Curves B, t [,] why? Curve s lear combato of bass fuctos Curve s affe combato of cotrol pots γ! P ( t) t!( )! Propertes of Bezer Curves γ (t) s polyomal of degree γ (t) s cotaed the covex hull CH(P,,P ) γ () P ad γ () P γ '() (P P ) ad γ '() (P P - ) γ (t) s affe varat ad varato dmshg γ (t) s tutve to cotrol va P ad t follows the geeral shape of the cotrol polygo γ '(t) s a Bezer curve of oe degree less Questos: What s the shape of Bezer curves whose cotrol pots le o oe le? How ca oe coect two Bezer curves wth C cotuty? C? C? 7 8 Drawbacks of Bezer Curves Degree correspods to umber of cotrol pots Global support: chage oe cotrol pot affects the etre curve For large sets of pots curve devates far from the pots Caot represet cocs exactly. Most otceably crcles Ca be resolved by troducg a more powerful represetato of ratoal curves. For example, a 9 degrees arc as a ratoal Bezer curve: P (,) P (,) P (,) wp B + wpb + w P B C( t) w B + w B + w B where ww. w 9 B-Sple Curves Idea: Geerate bass where fuctos are cotuous across the domas wth local support C( t) P N For each parameter value oly a fte set of bass fuctos s o-zero The parametrc doma s subdvded to sectos at parameter values called kots, {τ }. The B-sple fuctos are the defed over the kots The kots are called uform kots f τ - τ - c, costat. WLOG, assume c. Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo
Computer Graphcs Geometrc Modelg Uform Cubc B-Sple Curves Defto (uform kot sequece, τ - τ - ): γ PN, t [, ) r / 6 ( r + r + r + ) / 6 N (r 6r + 4) / 6 ( r) / 6 r t τ r t τ r t τ r t τ + + + t [ τ, τ ) t [ τ, τ ) + t [ τ, τ ) + t [ τ, τ ) + + + + + 4 Uform Cubc B-Sple Curves For ay t [, ]: (prove t!) N For ay t [, ] at most four bass fuctos are o zero Ay pot o a cubc B-Sple s a covex combato of at most four cotrol pots Let t γ t t [ τ, τ ) 4.The, PN ( t ) τ τ PN ( t ). Boudary Codtos for Cubc B-Sple Curves B-Sples do ot terpolate cotrol pots partcular, the uform cubc B-sple curves do ot terpolate the ed pots of the curve. Why s the ed pots terpolato mportat? Two ways are commo to force edpot terpolato: Let P P P (same for other ed) Add a ew cotrol pot (same for other ed) P - P P ad a ew bass fucto N - (t). Questo: What s the shape of the curve at the ed pots f the frst method s used? What s the dervatve vector of the curve at the ed pots f the frst method s used? Local Cotrol of B-sple Curves Cotrol pot P affects γ (t) oly for t (τ, τ +4 ) B-sple 4 γ Propertes of B-Sple Curves P N, t [, ) For cotrol pots, γ (t) s a pecewse polyomal of degree, defed over t [, ) U 4 γ CH( P,.., P + ) γ(t) s affe varat ad varato dmshg γ(t) follows the geeral shape of the cotrol polygo ad t s tutve ad ease to cotrol ts shape Questos: What s γ (τ ) equal to? What s γ '(τ ) equal to? What s the cotuty of γ (t)? Prove! 5 From Curves to Surfaces A curve s expressed as er product of coeffcets P ad bass fuctos C( u) PB ( u) Treat surface as a curves of curves. Also kow as tesor product surfaces Assume P s ot costat, but are fuctos of a secod, ew parameter v: P( m j Q B ( j j 6 Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo
Computer Graphcs Geometrc Modelg From Curves to Surfaces (cot d) The C( u) or S j PB ( u) m m j Q jb j ( B ( u) Q B ( B ( u) j j m ( u, Qj B j ( B ( u) BezPatch j Surface Costructors Costructo of the geometry s a frst stage ay mage sythess process Use a set of hgh level, smple ad tutve, surface costructors: Blear patch Ruled surface Boolea sum Surface of Revoluto Extruso surface Surface from curves (skg) Swept surface 7 8 Blear Patches Blear terpolato of 4 D pots - D aalog of D lear terpolato betwee pots the plae Gve P, P, P, P the blear surface for u,v [,] s: P P P ( u, ( u)( P + uvp + ( u) vp + u( P Questos: What does a soparametrc curve of a blear patch look lke? Ca you represet the blear patch as a Bezer surface? Whe s a blear patch plaar? P P x P y 9 4 Ruled Surfaces Gve two curves a(t) ad b(t), the correspodg ruled surface betwee them s: S(u, v a(u) + (-b(u) a(u) b(u) The correspodg pots o a(u) ad b(u) are coected by straght les Questos: Whe s a ruled surface a blear patch? Whe s a blear patch a ruled surface? 4 4 Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo
Computer Graphcs Geometrc Modelg Surface of Revoluto Rotate a, usually plaar, curve aroud a axs Cosder curve β(t) (β x (t),, β z (t)) ad let Z be the axs of revoluto. The, x( u, β ( u) cos(, y( u, β ( u) s(, z( u, β ( u). x x z Extruso of a, usually plaar, curve alog a lear segmet. Cosder curve β(t) ad vector V r The Extruso r S ( u, β ( u) + vv. 4 44 Sweep Surface Rgd moto of oe (cross secto) curve alog aother (axs) curve: The cross secto may chage as t s swept Questo: Is a extruso a specal case of a sweep? a surface of revoluto? 45 Copyrght Gotsma, Elber, Barequet, Kar, Sheffer Computer Scece - Techo