3D Concepts UNIT 3 3-D Coordinate Spaces • Remember what we mean by a 3-D coordinate space y axis y P z x z axis x axis Right-Hand Reference System Translations In 3-D • To translate a point in three dimensions by tx, ty and tz simply calculate the new points as follows: • x’ = x + tx y’ = y + ty z’ = z + tz (x, y, z) (x’, y’, z’) Translated Position Scaling In 3-D • To scale a point in three dimensions by sx, sy and sz simply calculate the new points as follows: • x’ = sx*x y’ = sy*y z’ = sz*z (x’, y’, z’) (x, y, z) Scaled Position Rotations In 3-D • The equations for the three kinds of rotations in 3-D are as follows: x’ = x·cosθ - y·sinθ y’ = x·sinθ + y·cosθ z’ = z x’ = x y’ = y·cosθ - z·sinθ z’ = y·sinθ + z·cosθ x’ = z·sinθ + x·cosθ y’ = y z’ = z·cosθ - x·sinθ Homogeneous Coordinates In 3-D • Similar to the 2-D situation we can use homogeneous coordinates for 3-D transformations - 4 coordinate y axis column vector y • All transformations can then be represented as matrices P P(x, y, z) = x y z 1 z x z axis x axis 3D Transformation Matrices Translation by tx, ty, tz 1 0 0 0 0 0 cos sin sin cos 0 0 1 0 0 tx Rotate About X-Axis 0 0 0 1 0 0 1 0 0 1 ty tz sx 0 0 0 0 0 0 1 cos 0 sin 0 0 sin 1 0 0 cos 0 0 0 0 sy 0 0 sz 0 0 Rotate About Y-Axis 0 0 0 1 0 0 Scaling by 0 sx, sy, sz 1 cos sin 0 0 sin 0 cos 0 0 1 0 0 Rotate About Z-Axis 0 0 0 1 Projections • Our 3-D scenes are all specified in 3-D world coordinates • To display these we need to generate a 2-D image - project objects onto a picture plane Picture Plane Objects in World Space • So how do we figure out these projections? Converting From 3D To 2D • Projection is just one part of the process of converting from 3D world coordinates to a 2D image 3-D world coordinate output primitives Clip against view volume Project onto projection plane Transform to 2-D device coordinates 2-D device coordinates 3D Viewing • In 2D viewing we have 2D window & 2D viewport & objects in the world coordinates. • The 3D viewing has an added dimension which makes it complex as even though objects are 3D the display devices are only 2D. • The mismatch between 3D objects & 2D displays is compensated by introducing projections. The projection transforms 3D objects into a 2D projection plane. • View plane: It is nothing but the film plane in a camera which is positioned & oriented for a particular shot of the scene. • World coordinates positions in the scene are transformed to viewing coordinates, then viewing coordinates are projected onto the view plane. • View reference point: This point is the center of our viewing coordinate system. • The production of a 2D image of higher dimensional object refers to graphical projection. • A projection can be defined as a mapping of any point P[x,y,z] to its image P`[x`,y`,z`] onto the view plane, called as projection plane. • Parallel & perspective projections are the two broad categories of projections. Types of Projections • There are two broad classes of projection: – Parallel: Typically used for architectural and engineering drawings. – Perspective: Realistic looking and used in computer graphics. Parallel Projection Perspective Projection Parallel Projections • Some examples of parallel projections Orthographic Projection Isometric Projection Perspective Projections • Perspective projections are much more realistic than parallel projections Geometric projection Parallel Orthogr aphic To p Fro nt Perspective Oblique Ax on om etr ic Other Twopoint Side elev atio n Cabinet Isometric Onepoint Cavalier Other Threepoint • Parallel projection: – If the direction of projection is perpendicular to the projection plane, it is an orthographic projection. – If the direction of projection is not perpendicular to the projection plane is called as oblique projection. – A multi-view projection displays a single face of a 3D object. – Axonometric projections allow the user to place the view-plane normal in any direction such that 3 adjacent faces of a cube like object are visible. – Dimetric projections differ from isometric projections in the direction of the view-plane normal. – Trimetric projections allow the viewer the most freedom in selecting the components of n. • Perspective projection: – It is a type of projection where 3D objects are not projected along parallel lines, but along lines emerging from a single point. – A vanishing point is a point in a perspective drawing to which parallel lines appear to converge. – One-point perspective exists when a painting plate is parallel to two axes of a rectilinear scene. – Two point perspective Assignment Orthographic Wireframe Elevation Orthographic Wireframe Plan Orthographic Wireframe End-Elevation Perspective View