chapter 4 · 3/3/2019  · an isometric projection is generated by aligning the projection plane so...

24
Chapter 4 3D TRANSFORMATION AND PROJECTION

Upload: others

Post on 12-Jul-2020

49 views

Category:

Documents


0 download

TRANSCRIPT

  • Chapter 4 3D TRANSFORMATION AND

    PROJECTION

  • 3D Transformation 3D transformation is just an extension of 2D transformation in the sense that it now takes z coordinates into consideration apart from the x,y and homogeneous coordinates while the basic approach for representing and manipulating objects remain same. Just as 2D any 3D transformation can be represented by [X ′] = [T][X] Where [X′] represents transformed object

    coordinates and [X] represents the original

    object coordinate and [T] is the 4X4

    transformation matrix. Translation If any point P(x,y,z) in 3D space is moved to position P′(x′,y′,z′) such that x′=x+∆x y′=y+∆y z′=z+∆z ∆x, ∆y, ∆z being the displacement of P in three principle direction respectively. Then we can express this 3D translation in homogeneous matrix form as

  • =

    Scaling The matrix expression for scaling transformation relative to the coordinate origin will be

    =

    Where sx,sy,sz are scale factors in x, y, z direction respectively. Applying methods similar to that used in 2D the transformation matrix for scaling w.r.t. a selected fixed point (xf,yf,zf) can be obtained as

    Rotation 2D rotation transformation is uniquely defined by specifying a center of rotation and amount of angular rotation. But these two parameters do not uniquely define a rotation in 3D space because an object can rotate along different circular paths centering a given rotation center and thus forming different planes of rotation. We need to fix the plane of rotation and this is done by

  • specifying an axis of rotation instead of a center of rotation. The radius of rotation path is always perpendicular to the axis of rotation. By convention positive rotation angles produce counter-clockwise rotation about a coordinate axis.

    Rotation about z axis If the rotation is carried out about the z axis the z coordinates remains unchanged while x and y coordinates behave exactly the same way as in two dimensions because rotation occurs in plane perpendicular to the z axis. x′=x cosθ-y sinθ y′=x sinθ+y cosθ z′=z The corresponding transformation matrix is

  • [TR]z,θ=

    Rotation about x axis Here rotation takes place in planes perpendicular to x axis hence x coordinate doesn’t change after rotation while y and z coordinates are transformed. y′=y cosθ-z sinθ z′=y sinθ+z cosθ x′=x The transformation matrix is in the form

    [TR]x,θ=

    Rotation about y axis This time we replace z axis with y axis and x and y axis with z and x axis respectively so that we get z′=z cosθ-x sinθ x′=z sinθ+x cosθ y′=y The transformation matrix is now

  • [TR]y,θ=

    Rotation about any arbitrary axis in space Like 2D transformation here also to carry rotation about any arbitrary line we have to align the line with one of the coordinate axes by some intermediate transformation. The rotation is performed as the rotation matrix is known in this case as a standard. Let us consider that the arbitrary axis in space passes through the point (x0, y0, z0) and the direction cosine of the line is (Dx, Dy, Dz). To rotate the object by an angle ϴ the steps are as follows: Step1: Translate the line so that the line passes through the origin of the coordinate system. It can be represented by the matrix

    =

    Step 2: The line is rotated so that it coincides with one of the coordinate axis e.g. Z-axis. Actually it requires two steps. Firstly we have to rotate about X-axis until the rotation axis is in the ZX plane and secondly rotation about Y axis until the rotation axis coincides with the Z axis.

  • The two steps of the transformation are described by the figure below.

    OA represent the unit vector along the given axis of rotation and OB is the projection of OA in the YZ plane. The amount of rotation requires to bring OA in the ZX plane is equal to α the angle between OB and Z axis.

    If OB= m then = = again

    m= For rotation about X axis by an angle α, the matrix is

  • X,α =

    =

    After rotation OA becomes OA´ , OB becomes OB´ and both are on the ZX plane. Let the angle between OA´ and Z axis be β in the ZX plane. OA´ is rotated by angle β about Y axis in clock wise direction in order to coincide with Z axis. We have = and = =Cx

    Hence the matrix for rotation about Y axis can be represented as

    Y,β =

    =

    Step 3: Rotation about Z axis by an angle ϴ, the transformation matrix being

    Z,ϴ =

  • Step 4: We have to take the reverse rotation about Y axis Y,β

    -1 and reverse rotation about X axis X,α

    -1 Step 5: Reverse translation is taken to make the object back to the original position -1

    The combination matrix thus becomes = -1 X,α

    -1 Y,β -1 Z,ϴ

    Y,β X,α Projection

    The problem of representing a three-dimensional object or scene in a two dimensional medium is solved by the technique of projection. Projection can be defined as a mapping of point P (x, y, z) onto its image P′ (x′, y′, z′) in the projection plane or view plane which constitute the display surface. The mapping is determined by a projection line called projector that passes through P and intersects the view plane. The intersection point is P′. The result of projecting an object is dependent on the spatial relationship among the projectors that project the points on the object and the spatial relationship between the projectors and the view plane

  • Related terms

    • Center of projection- The point from where projection is taken. It can be light source or eye position.

    • Projection plane- The plane on which projection of the object is formed.

    • Projectors- lines emerging from center of projection and hitting the projection plane after passing through a point in the object to be projected. Mainly these projectors are responsible for obtaining projection of an object.

    There are different categories of projection depending on the direction of projectors and also the relative position of the centre of projection and plane of projection. The major two categories of projection are: a) Parallel projection b) Perspective projection. The following figure describes taxonomy of the families of perspective and parallel projections

  • Parallel projection In parallel projection coordinate positions are transformed to the view plane along parallel lines. The center of projection is situated at infinite distance such that the projectors are parallel to each other. In parallel projection image points are found at the intersection of the view plane with parallel projectors drawn from the object points in a fixed direction. Different parallel projection of the same object results on the same view plane for different direction of projectors.

  • The two basic types of parallel projection are: a) Orthographic projection and b) Oblique projection. Orthographic projection It is a part of the parallel projection in which the center of projection lies at infinity. Orthographic projection occurs when the direction of projection is perpendicular to the plane of projection and hence true size and shape of a single plane face of an object is obtained. Orthographic projections are most often used to produce the front, side, and top views of an object. Front, side, and rear orthographic projections are called elevations and a top orthographic projection is called a plane view. It is commonly used in engineering drawing.

  • z

    P la n e o f p r o je c t i o n

    V ie w e r

    Axonometric projection In axonometric projection view plane is not parallel to the principle plane. This is used to overcome the limitation of single orthographic projection which is unable to illustrate the general three-dimensional shape of an object. The construction of an axonometric projection is done by using rotation and translation to manipulate the object such that atleast three adjacent faces are shown. The result is then projected at infinity onto one of the coordinate planes from the center of projection. An axonometric projection shows its true shape only when a face is parallel to the plane of projection.

  • Advantage and disadvantage

    • Lines are scaled (foreshortened) but can find scaling factors

    • Lines preserved but angles are not Projection of a circle in a plane

    not parallel to the projection plane is an ellipse

    • Can see three principal faces of a box-like object

    • Some optical illusions possible Parallel lines appear to diverge

    • Does not look real because far objects are scaled the same as near objects

    • Used in CAD applications Types of axonometric projection:-

    � Isometric projection- In isometric projection the direction of projection makes equal angle with all three principle axes. ‘Iso’ means ‘equal’ and ‘metric projection’ means ‘a projection to reduced measure’. An isometric projection is generated by aligning the projection plane so that it intersects each coordinate axis in which the object is defined. All three principal axes are foreshortened equally so that relative proportions are maintained.

    � Diametric projection- The direction of projection makes equal angles with exactly two of the principal axes. Here two foreshortening factors are equal and third is arbitrary

  • � Trimetric projection-The direction of projection makes unequal angles with three principal axes. It is formed by arbitrary rotations in arbitrary order about any or all of the co-ordinate axes. For each projected principal axis the foreshortening ratios are different.

    To explain the "Projection of the axes" let’s take a view of a cube so that its three principal faces are visible. Let’s place a transparent sheet of Perspex in front of the cube and draw lines where the front edges of the cube meet at a point. The angle between adjacent edges of a cube is always 90º. After drawing the outline of the converging edges on the Perspex we can measure the angles between them. We can see that the angle between adjacent edges is greater than 90º in all three cases i.e. µ>90º, ß>90º and Ø>90º. These are the angles between the projections of the axes. Theses axes are known as the axonometric axes. If the angle between all three axes are the same then an isometric view results (µ=ß=Ø); if two of the angles are the same then a dimetric view results (e.g.µß, ß=Ø); finally if all three angles are different a trimetric view results (i.e. µßØ).

  • Multiview Multiview is an orthographic projection in which view plane is parallel to the principal planes. This produces the front, top and side views of mechanical drawings. It always shows the true size and shape of a single plane face parallel to the projection plane. By combining multiple views like top & bottom view, front & rear view, right side & left side view of the same object the whole object can be reconstructed.

    • Front surfaces of object is parallel to plane of projection

    • Projectors or line of sights are perpendicular to projection plane

    • Projectors are parallel to each other and originate from any point on object

  • Advantage and disadvantage

    • Preserves both distances and angles Shapes preserved Can be used for measurements

    • Building plans • Manuals

    • Cannot see what object really looks like because many surfaces hidden from view

    Often we add the isometric Oblique Projection When the angle between the projectors and the plane of projection is not equal to 90° then the projection is called oblique projection. It is a part of the parallel projection and is formed by parallel projectors from a center of projection at infinity that intersect the plane of projection at an oblique angle. The true size and shape are shown only of those faces of objects that are parallel to the plane of projection and angle and lengths are preserved for these faces only. An oblique projection of these faces is equivalent to an orthographic front view. Faces which are not parallel to the plane of projection are distorted.

  • z

    y

    x

    V i e w e r

    Oblique projection There are two special cases of oblique projections:

    • Cavalier projection • Cabinet projection

    The cavalier projection is obtained when the angle between the oblique projectors and the plane of projection is 45° and the foreshortening factors for all three principal directions are equal. In cavalier projection the resulting figure is thicker. A cabinet projection is used to correct the distortion that is produced by cavalier projection. An oblique projection for which the foreshortening factor for edge perpendicular to the plane of projection is one half is called cabinet projection. For a cabinet projection the angle between the projectors and the plane of projection is 63.43°

  • Cavalier and Cabinet Projection of a 1 Unit Cube Advantage and disadvantage

    • Can pick the angles to emphasize a particular face

    Architecture: plan oblique, elevation oblique

    • Angles in faces parallel to projection plane are preserved while we can still see “around” side

    • In physical world, cannot create with simple camera; possible with bellows camera or special lens (architectural)

    Perspective projection

  • To obtain a perspective projection of any object we transform points along projection lines which are not parallel to each other and converge to meet at a finite point known as projection reference point or center of projection. The projected view is obtained by calculating the intersection of the projection lines with the view plane. Perspective drawing is characterized by perspective foreshortening and vanishing points. Perspective foreshortening is the illusion that objects and lengths appear smaller as their distance from the center of projection increases. The illusion that certain sets of parallel lines appear to meet at a point is another feature of perspective drawing. These points are called vanishing points. Principal vanishing points are determined by the apparent intersection of lines parallel to one of the three principal x, y, and z axes. A common manifestation of this anomaly is the illusion that rail road tracks meet at a point on the horizon.

  • Types of perspective projection

    � One point: The one principal vanishing point perspective occurs when the projection plane is perpendicular to one of the principal axes (x, y, z).

    � Two points: The two principal

    vanishing point perspectives occur when the projection plane intersects exactly two of the principal axes (x, y, z). Thus the line of sight is not perpendicular to two of the three principal directions but it is

  • perpendicular to the remaining one direction.

    � Three points: The three principal

    vanishing point perspectives occur when the projection plane intersects all three of the principal axes (x, y, z). The line of sight is not perpendicular to any principal axes.

  • Advantage and disadvantage

    • Objects further from viewer are projected smaller than the same sized objects closer to the viewer (diminution)

    Looks realistic • Equal distances along a line are not

    projected into equal distances (nonuniform foreshortening)

    • Angles preserved only in planes parallel to the projection plane.More difficult to construct by hand than parallel projections

  • Summery