0% found this document useful (0 votes)
58 views21 pages

3D Viewing

Text

Uploaded by

Unknown Is here
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
58 views21 pages

3D Viewing

Text

Uploaded by

Unknown Is here
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
51 Some graphics applications are two dimensional, such as charts, graphs certain maps and some artist’s creations may be strictly two dimensional entities. But we live in a world of 3D. In many design applications we must deal with objects describing in 3D. If the architect would like to see how the structure will actually look, then a 3D model can allow him to view the structure from different viewpoints. In this chapter we shall generalize our system to handle models of three dimensional objects. 5.2 3D Geometric Primitives : Until now we have seen two dimensional objects and the operations which we can perform on them. We know that to represent a 2D object we need x and Scanned with CamScanner emacomeurmuce) 3 sn rato that object. co-ordinates. He means to draw a 20 obj height in nature objects are having three dimensions, So 10 represent sch objects Bully we need three parameters, Ou of these thee parameters, wo we know. They Me width, Le. X co-ordinate, and height, ic. y co-ordinate, In 3D we need one ional parameter, which is called as depth and is represented by co-ordinate, Im 5p, only x and y-axis are there whereas in 3D, we are having 3 axes is yam spose thee axes are arranged in sucha way othe [Now itis important to recogni: eoordinate axis. A right handed system (RHS) hast er, If our right hand's four fingers (ie. other than thumb) | retin, then the thumb of righthand indicates positive ‘A left handed system (LHS) has the z-axis pointing away from the viewer Fig. 52.1 shows both right handed and lett fingers (i.e. other than thumb) are curling from x to y direction, then the thu sand points postive z direction. As most of geometry uses right handed system so we adopt the same for our use. they are normal to ferent orientations for the towards the from x to y y ‘Peale 2 ‘iecton Posive drecton (a) Right handed system (b) Lett handed system, Fl 2 j Now we can represent any point by a set of three values (x, y, 2). Here x represents horizontal distance, i.e. width, along x-axis Y represents vertical distance i.e. height, along Yaxis, and 2 represents depth along z-axis. Fig. 5.2.2 shows how to plot a 3D point. Let us ota point A (3,2, 1). lg 8:22 ‘Scanned with CamScanner Dy plot a AD point we ail follow sone steps Step Le Mota point A%A,0, Ds ay plot this point we have fo draw one pale Te 0 Z-Ni8 A a stan gp Vaiss. A. Now daw pall Hine 10 x=AKl8 AW stance OF Fg iis 1 The point where these two Hines intersects Wil be pin hag = Ubuty 0, xe Nand Ave waa pin as (8, 2,1 we fe fo HR the pout A” (3, 0, 1) up py 2 units fe, y= 2, So ara’ a para tno to y-avis from AM (3,0, 1) pony iilaly, draw a point A’, 2,0) and draw a parallel Hine from this pont NG, 2.0) 10 avis, Similarly, plot & polat A” (0, 2, 1) and then dea 4 ppaallel tine form this point to X-axis, ‘The polit at which these thee tines intersects fy ou requited point A (3,2, Ds ig. 5.2.2 shows different 3D points, Hg. 82.8 ‘Scanned with CamScanner (BF cooper Gries CFT 30 Transformations Like this we can represent a line also, In 2D equation ofa line is, yy wey xox Toe ie. Asx changes, y also changes accordingly. similarly in 3D as x changes both y and z will get changed accordingly. So to ta line in 3D we need a pair of equations. evita oye xox, 7 =x, repese 2-4 us and 224 2 BO xox, =x It requires the (X;, y1, 21) and (x2, yz, 22) ie. the co-ordinates of two points. We cantepresent the equation of a line in parametric form also. x =x t(a-x)U y =ytQa-yu 2 yte-2)u §3__ 3D Object Representation Many real-world objects are inherently smooth; therefore need infinitely many pints to model it. This is not feasible for a computer with finite storage. More often ‘we merely approximate the object with pieces of planes, spheres, or other shapes that ‘av easy to describe mathematically. ‘When we are representing a 3D object in computer graphics, the graphics scenes can contain many different kinds of objects. Not a single method is in a position to describe all these methods. If we are using accurate models they produce a realistic ‘isplay of scenes. 534 Polygon Tables : Weccan specify a polygon surface witha set of vertex coordinates and associated atibute parameters, This information of polygon is placed in tables such as geometric ‘bles and attributes tables. The geometric tables for polygon contal ienity the spatial orientation of the polygor ‘bles for an object includes parameters speci ‘hject and its surface reflectivity and texture characteristics. in vertex coordinates and parameters to mn surface, On the other hand attribute fying the degree of transparency of the ‘Scanned with CamScanner = espe coingerices) 54 Dre, ws Geometic data for the polygon i represented Using thee tables ie, «yg table, en edge table and a polygon table. Vertex table stores the coordinate Vals fa ‘erties ofan abject To deny the vertes foreach polyson edge, ce tabiey address into vertex table, The polygon table holds pointers into the edge table 5 identify the edges for each polygon. 5.3.2 Solid Modeling: One of the major field in computer graphics is modeling of objets and pcre, Most geometic objects we see every day are solids. Designing representation fg Solids is a difficult job and compromises are often necessary. In this secon, ya introduce sweep representation, boundary representations and constructive sj geometry, 5.3.2.1 Sweep Representation : ‘Sweep representations are used to construct 3D object from 2D shape. There ae two ways to achieve sweep. Translation sweep : In translation sweep, the 2D shape is swept along a linear path normal to the lane of the area to construct 3D object. To obtain the wireframe representation we have to replicate the 2D shape and draw a set of connecting lines in the direction of shape, as shown in Fig. 5.3.1. x IAS (20s “Oat one open a Rotational sweep : In rotational sweep, the 2D shape is rotated about an axis of rotation specified in the plane of 2D shape to produce three dimensional objects, I v=[ Fig. 532 ‘Scanned with CamScanner FE corgtn rots PTY) 57 jee Fig. 53.2 shows a rotational sweep creates fons are widely-used in computer vision a cylindrical object. Sweep However, the generation of Spirary objects becomes rather difficult using this technique. 5322 Constructive Solid Geometry : Another technique for solid modeling is to combine the volumes occupied by verlapping 3D objects using Boolean set operations. tonsuctive solid geometry (CSG). It creates a new This modeling tech. is called volume by applying Boolean cpentors such as union, intersection, or difference to two specified objects. The Fig. 533, 53.4, 5.3.5 show the examples for forming new shapes using Boolean set operations. The Fig. 5.3.3(a) shows two rectangle blocks are place sducent 10 each other. We can obtain object with the union operation as shows Ss SS Fig.53.30)- (2) Objects () Combined objects Fig. 533 : Combined object by union operator The Fig. 5.34 shows the result of intersection operation obtained by overlapping ‘linder and cube. With the difference operation, we can obtain the resulting solid as stown in Fig. 5.3.5. @ Fig. 534 CSG representations are particularly useful for Of features corresponding to material addition or ckes ete, Some of the important properties of CSG include conciseness, I capturing design intent in the removal such as bosses, holes, guaranteed ‘Scanned with CamScanner 6 30 Transiomaing ‘Computer Graphies (UPTU-Comp) validity of solids, computationally convenient boolean algebraic properties, and nay control of a solids shape in terms of high level parameters defining the soi... primitives and their positions and orientations. ‘The CSG method uses three dimensional objects such as blocks, pyramids, cylinders, cones, spheres, and | closed spline surfaces to generate other solid objects. Fig sas 5.3.2.3 Boundary Representation (B-REPS) : Boundary representation, which is referred as B-rep in short, can be treated as an extension to the wireframe model. In boundary representation a solid is bounded by its surface and has its interior and exterior. The surface of a solid contains a set of faces, which is in tur a piece of some surface. Faces may share vertices and edges. Topological and geometric are the two type types of information in a Boundary representation, Topological information gives the relationships between edges, vertices and faces. It is very similar to one which is referred in a wireframe model. Orientation of edges and faces are also included in topological information. Geometric information is generally the set of equations of the edges and faces, 5.3.24 Octrees : Octrees are the hierarchical structure used to represent solid objects in some graphics systems. The tree structure of octrees is organized so that each node corresponds to a region of three dimensional space. Cctrees are in turn derived from quad-trees, an encoding scheme used for representing two dimensional images. The fundamental idea behind both the quad-tee and octree is the divide-and-conquer power of binary subdivision. A quad-tree is derived by successively dividing a 2D plane (usually square) into quadrants. After fist subdivision, each node in the quad-tee has four data elements, one for each of tH ‘quadrants in the region, as shown in the Fig. 5.3.6. These quadrants can be of ¥° types: homogeneous or heterogeneous, ‘Scanned with CamScanner (computer Graphics (UPTU-Comp) 50 20 Transformations fo) Region 2D | Quadrant | Quadrant ofifa}s Space 0 1 Quadrant | Quadrant (®) Data elements inthe 3 2 representative quad-tree node Fig, 536 ‘The quadrant is said to be homogeneous quadrant the color information for that «yadrant is stored in the corresponding data element of the node. In addition, a flag is set in the data element to indicate that the quadrant is homogeneous. ‘The heterogeneous quadrant contains pixels of different colors. Such quadrant is itself divided into quadrants as shown in the Fig. 5.3.7. The new generated quadrants are ctecked for homogeneous quadrant. If some of them are heterogeneous then they are again subdivided and the process is repeated until all quadrants are homogeneous or unt a predetermined cut-off depth is reached. 7 : oT ets ols ° betel PLETE) (@) Region 2D space (©) Quad-tree representation ig. 537 Quad-tree encoding scheme provides considerable saving in storage, since each ‘lor ‘area’ is represented by a single node. For an area containing 2n by 2n pixels, a ‘Hed-tree representation contains at most n levels. In case of black and white image homogeneous quadrants are either completely 41 or completely empty (E). Fig. 5.3.8 shows the quad-trees for 2 such images. Tage A ‘Quactioeforimage A Fig. 53.8 (0) ‘Scanned with CamScanner ae undo orig 8 Fi 53806) Performing Boolean set operations such as union and intersection on above jy aquaad-tres are get resultant images and quad-trees as shown inthe Fig, 5.3.9, (a) Resultant image and quad-tee after union operation (AUB) OQ. © 9 © © () Resultant image and quad-tre after intersection operation (AB) Mig 539 5.3.2.5 Comparison of Representations : ‘Table 3.3.1 : Comparison of representation Parameter _| Sweeps Bereps csG Octree ‘Accuracy | High Sometimes High High ions Domain Limited | Can represent Limited to some _ | Limited wide class of | extend objects ‘Scanned with CamScanner puter Graphios (UPTU-Comp) __| Notunique ' Parameter Sweep: | Uniqueness Unique Validity Easy to Most difficult to | validate Closure Not closed under closure problems: | Boolean under Boolean | operations j \Compactness_| More Compact and cad compact evaluation is not | efficiency and | | efficient | —__ _ More compact needs evaluation Unique Easy to Closed Compact ‘Scanned with CamScanner 5.5__ Projections : Tey We know that the objects available in nature are described in world-coordinate system. But all graphics display media are two dimensional, such as screen of monitor, printout of printer etc. when we want to draw a 3D object on a monitor, we have to convert the world coordinates into screen coordinates. For this we have to project a 3D object on a 2D plane, here 2D plane will be screen of monitor. Projection is nothing but a shadow of the object. Ideally an object is projected by projecting each of its points. As there are infinitely many points in an object, we are not producing projections of all those points. Instead of that we will take projections of only corner points of an object on 2D plane and then we will join these projected points by straight line in 2D plane. There are two basic projection methods. Parallel Projection Perspective Projection Scanned with CamScanner omputor Graphics (UPTU-Comp) 5.43 30 Transformations 551 Parallel Projection : A parallel projection is formed by extending parallel lines from each vertex of the object until they intersect the plane of the screen. The intersection point of the screen is nothing but the projection of the vertex. We connect these projected vertices by straight lines on screen, which correspond to connections on the original object. See Fig. 55.1. y Fig. 58.1 Here we are taking projection of each vertex of the object tll it intersects to the plane of screen, The plane on which we are taking projection is called as view plane. If ‘we want to represent a 3D object on 2D plane, the most simple way is to discard the ce-ardinate, We are discarding the 2 co-ordinates only when the screen or viewing surface is parallel to the xy plane and the lines of projection are parallel to the z-axis A parallel projection preserves relative properties of objects, in x and y direction. ‘Accurate views of the different sides of an object are obtained with a parallel ejection, but it fails to give us a realistic representation of a 3D object. Let us take an example. Suppose there y is a 3D cube in space and we want to draw it ‘on screen i.e. on xy plane. See Fig, 5.5.2 We obtain the parallel projection of a point (x), y4, 2) by drawing a line through this point with a certain direction (xp. Yqs 2p) i in space. This line is called as projection LE Pirvonay stor. Te pnt where this ine interes ce sr the plane z = 0 is the parallel projection of the * given point; it has the coordinate (x, Yo, 0) Fig. 552 ‘Scanned with CamScanner Computer Graphics (UPTU-Comp) s 30 Transtermas We will write the equation fora line passing through the point (x,y, 2,) andthe direction of projection. x = xytayu yey t ypu thu whereu = 0101 Xp = 7X) Ye = 2-9) % = (%-%) Now we have to find at which point this line intersects the xy plane. It means ‘what will be x and y values at which z becomes zero. If we place z= 0 in above equation we will get Leyte putz = 0 0 = 2,420 2D = x+(—). rena 2 ane 2 0 * When the projection lines are normal (Perpendicular) to the projection plane, the projection is called orthographic projection, * We obtain this projection by setting z co-ordinate to zero. ‘+ This projection is a good approximation of the actual projections that the human ‘eye makes in the real world, Orthographic projections do not change the length of line segments which are Parallel to projection plane. Other lines are projected with reduced length. ‘Scanned with CamScanner 30 Transformations router Grapes (UPTU-Como) Generally we are using orthographic projections in engineering drawings 10 produce front, side and top view of an object. Fig. 5.5.3 shows different view of an object. Tia vow Fig. 553 Here by using orthographic projections we can draw any sides view of an object. But we can also form orthographic projections in such a way that more than one face of an object can be displayed. Such views are called as axonometric orthographic Froject ‘There are three types of axonometric orthographic projections. They are 1. Isometric 2. Diametric 3. Trimetric '\ Isometric projections : The most commonly used axonometric projections are isometric projections. In ‘ometric projections, the projections are aligned in such a way that all the edges will ‘Poear shortened by same distance. See Fig. 5.54. (a) and (b) vay HEME Consider an object as cube then side view, font view and top view look Tike square. ie. we are able to see only one face at a time. But by using tic orthographic projection we can see more than one face. The object shown in "5.5.4 (a) will look like as shown in Fig. 5.5.4. () ‘Scanned with CamScanner PEP computer Grapes (UPTU-Comp) 540 Top view se ew Frou view @ © © Fig 584 Here all three principal axes are shortened equally so that relative proportion’s are maintained. 2 Diametric Projection : In diametric projections, the direction of Projection is in such a way that the edges parallel to only two principle axes are equally shortened. In diametric projections, a cube will appear as shown in Fig. 5.5.5. Fig. 555 3. Trimetric Projection : In trimetric projections, the direction of Projection is in such a way that none of the three edges are equally shortened. Fig. 5.5.6. shows appearance of cube in trimetric projection. es are normal ot normal to view plane, then iti called Orthographic pcjecton Obiaue projection Fig. 8.5.7 ‘Scanned with CamScanner mp) 87, 30 Transformations oblique projection is obtained by projecting points se not perpendicular to the view, plane such cass shadows on the ground, We have Cavalier Cabinet {Cavalier Projection : Parallel lines that 4 projection appears in nature when {0 types of oblique projections. Cavalier projection is a special case of oblique projection, This occurs when the ojtion vector forms an angle of 45° with the z-axis, The line ‘bezanis are projected with no change in length, Consider an object whose edges pune to view plane xy. See Fig. y 8 which are parallel to axes and front face of the object is, Fig. 588 As the projections are not perpendicular to view plane, we will not get only one ‘se ofthe object. But as the angle of projection is 45°, we will get 2-a bu ‘ject, values as it X and y-axis values gets reduced. So the object will look tike an elongated cabinet Projections: |m cabinet projections we are having only half the actual z distance along the “Etted axis, It uses a projection vector that forms an angle of approximately 26.6° “hth ani, See Fig. 5.5.9. As the projections are making angle of 26.6° (= 30°), the z-axis values get Pa Criginal values, Cabinet projections appear more realistic than cavalier "ettions because of this reduction in the length of edges which are perpendicular to plane, ‘Scanned with CamScanner ‘e 5 Projection Fig 559 5.5.2 Perspective Projection : GEERT In real world, the objects which are away from the viewer, appear smaller, Perspective projection preserves this property. In perspective projection, the lines of Projection are not parallel. Here all projection lines are ending at a single point called center of projection. In real world this center of projection is human eye, For perspective projection see Fig. 5.5.10. ‘Center of rejection Fig. 55.10 To draw the image of object on 2D plane, assume that the object is in space having some x, y, and z values, We have to draw the image on xy plane, so the center of projection should be beyond the xy plane, All projections which are originating from different vertices of object meet at center of projection point, intersecting XY plane. Assuming thatthe plane xy or sereen is placed at 2 = 0, ‘Scanned with CamScanner compte Graphics (UPTU-Com) 549 So the distance of the center of projection from the xy plane, i.e. plane whose z = 0 is called ‘d’. With this assumptions computations become more " simple. The projection of a point is the intersection of the straight line from that point to the center with the plane z = 0. Fig. 55.11. shows side view of the projection of the point (x, y, 2) which gives projected point (x. ¥,) Fig. $5.11 ‘To draw the image of an object we have to find the values of (%p ¥9) ‘ipypisintersection point of projection with sereen. To obtain y,, we have to say i .& Go 74 n= (eta) Similarly to obtain Xp, we have to consider top view of Fig. 5.5.10. It will be as own in Fig. 5.5.12. as Fig 55.2 He,t find xy, we have 1 sy a % (z+4) d ‘Scanned with CamScanner [Et cont cng urrucong) _ a0 20Tenomtns ++ The co-ordinates of projected point on screen are (d * x) (d*y) % der 4 2) ov I is not compulsory to take z = 0 and center on z-axis. We can have center on any other axis also, but then we have to use translation also and due to ‘this ‘computations will increase. Here we are using z-axis as it generates simple formula to find projected point on screen, Types of Perspective Projections : ‘Vanishing point on the view plane is referred as a point where all the lines which are not parallel to view plane are appeared to meet. There are different types of Perspective projections based on the number of vanishing points. We can have one Point, two point and three point perspectives. 5.5.2.1 One point Perspective : One point perspective occurs when the projection plane is parallel to two Principal axes. Conversely, when the projection plane is perpendicular to one of the principal axis, one point perspective occurs. Receding lines along one of the principal axis converge to a vanishing point. Refer Fig. 5.5.13 y Fig 5.5.3, 5.5.2.2 Two Point Perspective : If the projection plane is parallel to one of the principal axes or if the projection plane intersects exactly two principal axes, a two-point perspective projection occu Refer Fig. 5.5.14. ‘Scanned with CamScanner moult Graphics (UPTU-Comp) ee Fig. Ss.14 5523 Three Point Perspective : If the projection plane is not parallel to any principal axis, a three-point pijecton occurs. Refer Fig. 5.5.15 Py, Py vm Fie 558 §8 90 Viewing Parameters: TEE We can form a 2D image from 3D object by using parallel and perspective ‘Mjections. But if we want to look at the object from other side or from bottom side or ‘om behind then we have to apply some rotation transformations on the object before ipcting, Here we are having two options. Keep view plane fixed and rotate the object. Keep object fixed and view plane is repositioned. Generally we are using second option where object is fixed and the view plane, Plane on which projections are taken is shifted. Let us take an example of °Brapher camera, When we arc taking photograph of any object, an image of ‘Scanned with CamScanner Zomputor Graphics (UPTU-Comp) 5.52 0 Transformatog object is developed on paper. Here developing paper is acting a8 a view plane. If we change the position of camera, naturally we are getting another view of an objec, See Fig. 5.6.1. d) re + Wow Fi 2 ‘camera Comera2 Fig. 546.1 By setting the viewing parameters we can change the camera position, The first Parameter is view reference point (Xyq, Yvg, Zyx)- This point is a center of attention Other parameters are expressed relative to this point, If we rotate the view it will be a rotation about the view reference point. We can consider as if a elastic thread is tied to view reference point and other end of that thread is tied to camera (view plane). By changing the other parameters we can change the position of the camera, Another parameter is view plane normal vector [DXN, DYN, DZN]. This is a vector which gives direction of elastic thread, which is Perpendicular to view plane. It means the camera will always looks along the string toward the view reference point, See Fig. 5.6.2. HE ‘The third parameter, view-distance parameter, gives the length of the string from view reference point to view plane or camera. The view plane is placed few distance away from the view reference point in the direction of view plane normal View plane Fig, 862 These parameters allow the user to select how to view the object. ‘Scanned with CamScanner

You might also like