This preview shows pages 1–8. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CM0268 MATLAB DSP GRAPHICS 1 515 JJ II J I Back Close Lines, Curves and Surfaces in 3D Lines in 3D In 3D the implicit equation of a line is defined as the intersection of two planes . (More on this shortly) The parametric equation is a simple extension to 3D of the 2D form: x = x + ft y = y + gt z = z + ht CM0268 MATLAB DSP GRAPHICS 1 516 JJ II J I Back Close Parametric Lines in 3D v w t w v + t w v = ( x , y , z ) p = ( x, y, z ) x = x + ft y = y + gt z = z + ht This is simply an extension of the vector form in 3D The line is normalised when f 2 + g 2 + h 2 = 1 CM0268 MATLAB DSP GRAPHICS 1 517 JJ II J I Back Close Perpendicular Distance from a Point to a Line in 3D For the parametric form, x = x + ft y = y + gt z = z + ht This builds on the 2D example we met earlier, line par point dist 2d . The 3D form is line par point dist 3d . dx = g * ( f * ( p(2)  y0 )  g * ( p(1)  x0 ) ) ... + h * ( f * ( p(3)  z0 )  h * ( p(1)  x0 ) ); dy = h * ( g * ( p(3)  z0 )  h * ( p(2)  y0 ) ) ... f * ( f * ( p(2)  y0 )  g * ( p(1)  x0 ) ); dz =  f * ( f * ( p(3)  z0 )  h * ( p(1)  x0 ) ) ... g * ( g * ( p(3)  z0 )  h * ( p(2)  y0 ) ); dist = sqrt ( dx * dx + dy * dy + dz * dz ) ... / ( f * f + g * g + h * h ); The value of parameter, t , where the point intersects the line is given by: t = (f * ( p(1)  x0) + g * (p(2)  y0) + h * (p(3)  z0)/( f * f + g * g + h * h); CM0268 MATLAB DSP GRAPHICS 1 518 JJ II J I Back Close Line Through Two Points in 3D (parametric form) P Q The parametric form of a line through two points, P ( x p , y p , z p ) and Q ( x q , y q , z q ) comes readily from the vector form of line (again a simple extension from 2D): • Set base to point P • Vector along line is ( x q x p , y q y p , z q z p ) • The equation of the line is: x = x p + ( x q x p ) t y = y p + ( y q y p ) t z = z p + ( z q z p ) t • As in 2D, t = 0 gives P and t = 1 gives Q • Normalise if necessary. CM0268 MATLAB DSP GRAPHICS 1 519 JJ II J I Back Close Implicit Surfaces An implicit surface (just like implicit curves in 2D) of the form f ( x, y, z ) = 0 We simply add the extra z dimension . For example: • A plane can be represented ax + by + cz + d = 0 • A sphere can be represented as ( x x c ) 2 + ( y y c ) 2 + ( z z c ) 2 r 2 = 0 which is just the extension of the circle in 2D to 3D where the centre is now ( x c , y c , z c ) and the radius is r . CM0268 MATLAB DSP GRAPHICS 1 520 JJ II J I Back Close Implicit Equation of a Plane ( a, b, c ) O d The plane equation: ax + by + cz + d = 0 • Is normalised if a 2 + b 2 + c 2 = 1 . • Like 2D the normal vector — the surface normal — is given by a vector n = ( a, b, c ) – a, b and c are the cosine angles which the normal makes with the x, y and zaxes respectively. CM0268 MATLAB DSP GRAPHICS 1 521 JJ II J I Back Close Parametric Equation of a Plane ( f 2 , g 2 , h 2 ) ( f 1 , g 1 , h 1 ) O ( x , y , z ) x = x + f 1 u + f 2 v y = y + g 1 u + g 2 v z = z + h 1 u + h 2 v • This is an extension of parametric line into 3D where we now...
View
Full
Document
This note was uploaded on 01/24/2012 for the course CM 0268 taught by Professor Davidmarshall during the Winter '11 term at Cardiff University.
 Winter '11
 DavidMarshall

Click to edit the document details