Lecture 5 Editing and Transformation
Modeling Model can be produced b the combination of entities that have been edited. D: circle, arc, line, ellipse 3D: primitive bodies, etrusion and revolved of a profile Before editing fter editing Before editing fter editing (a
Editing: surface and solid Part to be edited Surface Surface Surface Surface Before Editing on surfaces fter B B- B Cutting of Solid modell
Differences: D and 3D editing (X cos θ - Y sinθ, sinθ + Y cosθ (X,Y is Plane θ Center of rotation D: ais (, 3D: plane D: point 3D: ais Z Y Plane XY Plane YZ X θ Center of rotation θ Rotation ais Plane ZX
Editing Tpes of editing Fillet Chamfer Trim Scale Mirror 3D: Boolean Operation Translation Rotation Cop rra Offset Some editing preserves it original shape such length and angle and some don t. D editing is similar to 3D editing. Understanding CS is ver important to find the relationship.
Eample editing Circle Line Spline Y rra D and 3D Surface Z X 3D ine ΔY Z Y X Paksi Z Paksi X Paksi Y
Geometric Transformation Calculates l the new coordinates when transformation is applied to the geometric model. The geometric model can be wireframe, surface and solid. Editing commands are in fact transformations e.g scale, mirror, move.
Editing and transformation: relationship O B (X +ΔX, Y +ΔY C D Scaling points BCD on point O Line is etended from O (X B +ΔX, Y B +ΔY (X, Y ΔY (X C, Y C (X C +ΔX, Y C +ΔY ΔY O O (X B, Y B ΔX ΔX (a (b B B O D C D C (c
Model Representation Before appling the transformation matrices, the geometrical properties of the entities must be represented as matrices in its homogeneous coordinates in D or 3D. Rectangle (, (,(,(,,, n n n n z z z n Cube (,, (,, (,,
Convert to their homogeneous representation (3, (3,3 Y (,, (, (, ( (,, (,,, (,, (,, (,, Z X (,, Z Y (,, (,, (B (C X (,,
ppling transformation matrices [ ] D n n n n z z [ ] D z z z z 3 n n n z z n n n
Translation D Translation [ ] TR Δ Δ 3D Translation [ ] TR Δ Δ Δz Component-wise addition of vectors + d + d z z + dz To move polgons: translate vertices (vectors and redraw lines between them Preserves lengths and angles Does not require reference point
Rotation Rotation D [ ] R cos θ sinθ (X cos θ -Y sinθ, sinθ + Y cosθ (X,Y θ sin θ cosθ Rotation of vectors through an angle cos Ө sin Ө sin Ө + cos Ө Preserves lengths and angles Point of rotation point (, Center of rotation (,
Rotation at other point than origin point L t th t th t f t ti i ( Let sa that the center of rotation is (,. Translation has to be carried before and after rotation Procedure. Convert the (, to (, b appling translation - and -.. ppl the rotation matri 3 Convert the ( to its original point ( b 3. Convert the (, to its original point (, b appling translation and. [ ] R n n n n
3D Rotation cosθ sinθ cosθ sinθ sinθ cosθ R Y sinθ cosθ [ R X ] [ ] is of rotation: [ ] ΤR Z cosθ sinθ sinθ cosθ is of rotation: z is of rotation: If ais of rotation other than specified ais: appl translation before and after 3D rotation is applied
Scaling D and 3D [ ] R O S S B [ Τ ] S S S S Z Scaling points BCD on point O Line is etended from O O O (a D C D O (b B B C D (c C Component-wise scalar multiplication of vectors S S Does not preserve lengths Does not preserve e angles (ecept when scaling is uniform Point of reference for scaling is (, D and (,, 3D Scaling at other than (, or (,,, appl translation before and after appling scaling transformation
Foundation of transformations Similar method can be applied on other transformation such as shear, reflection etc. Important, if the transformation requires point (D, ais (D & 3D and plane (3D at the origin CS. Translation must be applied before and after appling the respective transformation.
ppling transformation composite matrices Do this transformation on screen. Draw rectangle an size. Translate d 6 3. Rotate it b 45. The same rectangle. Rotate it 45 3. Translate d 6 Q: Do both rectangles overlapping each other? Wh?
Composite Transformations Y 6 5 4 3 3 4 5 6 7 8 9 X Translation Rotation Y 6 5 4 3 3 4 5 6 7 8 9 Rotation Translation X
Composite Transformation [ ] [ ][ ][ ] [ ] C 3... n [ ] X [ X ][ ] C Composite Transformation: C bi ti f lti l t f ti Combination of multiple transformations must be in sequence.
X Mapping Mapping finds the relationship between two coordinate sstem a a a a3 [ Τ ] MP a a [ ] Δ a Δ MP a a3 Δ a a 3 Δ a a 3 33 Δz YY P (X,Y Mapping combines the rotation and translation. D mapping: ΔY ΔX X a to a : T R 3D mapping a to a 33 : T R-X, T R-Y and T R-Z
Mapping: eample Write the composite transformation for mirroring square BCD using ais ( 3 slope line through (, is (, 3 D C B
Solution Y Y Y (, X D X C B Y (, X D X C B. Translation. Rotation 3. Mirror 4. Rotation ti 5. Translation (a Translation (b Rotation B B B C C C D Y (, D X D C Y (, D X D C Y D C B (c Mirror B (d Rotation B (, X (e Translation
Solution Matrices [ ] [ ][ ][ ][ ][ ] M [ ] [ ][ ][ ][ ][ ] 3 sin( 3 cos( TR R MR R TR M [ ] [ ] 3 cos( 3 sin(, TR R [ ] [ ], cos(3 sin(3 sin(3 cos(3, R MR [ ] TR
Solution. Mapping. Mirror 3. Mapping B C B C D Y Y D D C Y ΔX (, X D ΔY X C B Y ΔX (, X D ΔY X C B ΔY Y X (, (c Mapping B (a Mapping (b Mirror
Solution Matrices [ M ] [ ][ ][ ] MP MR MP cos( 3 sin( 3 [ ] sin( 3 cos( 3, [ ] cos(6 sin(6 MP MR [ ] MP cos(3 sin(3 sin(3 cos(3 cos(6 sin(6
Discuss the following problem Square (,, B(,, C(, D(, Write down the matrices involved onl without mathematicall solving them to establish the following transformation. X ais ( Y Y - Y -X Y -X -5
pplication of transformation Movement of mechanism Modeling Head Shaft Point composition decomposition ids realism in computer graphic: projection