Presentation is loading. Please wait.

Presentation is loading. Please wait.

I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III Kansas State University CIS 636 Fundamentals.

Similar presentations


Presentation on theme: "I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III Kansas State University CIS 636 Fundamentals."— Presentation transcript:

1 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III Kansas State University CIS 636 Fundamentals Lecture 5 of 6 3-D Viewing 3: Viewing and Normalizing Transformations OpenGL Primer – Shading (Chapter 6) Reading: chapter 15 of the textbook Lab: Oblique Projection, Smooth (Gouraud) Shading Slides by Andy van Dam – adapted with permission

2 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 1/42 Review from last time: –specifying a 3D view—setting up the synthetic camera –the shape of the 3D view volume which is the clipping region The mathematics of planar geometric projections –how do we get from the view specification to the 2D picture? Lecture roadmap –deriving 2D picture from 3D view parameters is a hard problem –our method relies on fact that it’s easier to make a picture from the canonical view volume (3D parallel projection cuboid) at canonical view position (camera at the origin, looking down the negative z-axis) than it is from the user’s specified arbitrary position. Break into three steps: 1.get parameters for view specification (covered in last lecture) 2.transform from specified view volume into canonical view volume 3.using canonical view, clip, project, and pixelize scene to make 2D picture Viewing in Three Dimensions: Mathematics of Projections

3 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 2/42 Reduce degrees of freedom Five steps to specifying view volume 1.position camera (and therefore its view/film plane) 2.point it at what you want to see, with camera in the orientation you want 3.define field of view (for a perspective view volume, aspect ratio of film and angle of view: somewhere between wide angle, normal, and zoom; for a parallel view volume, width and height) 4.choose perspective or parallel projection 5.determine the focal distance Stage One: Specifying a View Volume

4 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Perspective Projection: Truncated Pyramid – Frustum Look vector is the center line of the pyramid, the vector that lines up with “the barrel of the lens” Note: For ease of specification, up vector need not be perpendicular to Look vector, but they cannot be collinear Andries van Dam September 22, 2005 3D Viewing III 3/42 Examples of a View Volume (1/2) Up Far Near Height Width Look

5 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Orthographic Parallel Projection: Truncated View Volume – Cuboid Orthographic parallel projection has no view angle parameter Andries van Dam September 22, 2005 3D Viewing III 4/42 Examples of a View Volume (2/2) Height Width Look vector Near distance Position Far distance Up vector x y z

6 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 5/42 Placement of view volume (visible part of world) specified by camera’s position and orientation –Position (a point) –Look and Up vectors Shape of view volume specified by –horizontal and vertical view angles –front and back clipping planes Perspective projection: projectors intersect at Position Parallel projection: projectors parallel to Look vector, but never intersect (or intersect at infinity) Coordinate Systems –world coordinates – standard right-handed xyz 3-space –viewing reference coordinates – camera-space right handed coordinate system (u, v, n); origin at Position and axes rotated by orientation; used for transforming arbitrary view into canonical view Specifying Arbitrary 3-D Views

7 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 6/42 We have now specified an arbitrary view using our viewing parameters Problem: map arbitrary view specification to 2D picture of scene. This is hard, both for clipping and for projection Solution: reduce to a simpler problem and solve Note: Look vector along negative, not positive, z-axis is arbitrary but makes math easier Arbitrary View Volume Too Complex – there is a view specification from which it is easy to take a picture. We’ll call it the canonical view: from the origin, looking down the negative z-axis – parallel projection – sits at origin: Position = (0, 0, 0) – looks along negative z-axis: Look vector = (0, 0, –1) – oriented upright: Up vector = (0, 1, 0) – film plane extending from –1 to 1 in x and y – think of the scene as lying behind a window and we’re looking through the window Look Up n v u

8 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 7/42 Goal –transform our arbitrary view and the world to the canonical view volume –maintain relationship between view volume and world –take picture Normalizing transformation –for parallel view volume, transformation is affine: made up of translations, rotations, and scales –in case of a perspective view volume, it also contains a non-affine † perspective transformation that turns a frustum into a parallel view volume, a cuboid –composite transformation that will transform arbitrary view volume to canonical view volume, named the normalizing transformation, is still a 4x4 homogeneous coordinate matrix that typically has an inverse –easy to clip against this canonical view volume; clipping planes are axis-aligned! –projection using canonical view volume is even easier: just omit z-coordinate –for oblique parallel projection, a shearing transform is part of composite transform, to “de-oblique” view volume Normalizing to the Canonical View Volume † Affine transformations preserve parallelism but not lengths and angles. The perspective transformation is a type of non-affine transformation known as a projective transformation, which does not preserve parallelism

9 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 8/42 Problem of “taking a picture” has now been reduced to problem of finding correct normalizing transformation It is a bit tricky to find the rotation component of the normalizing transformation. But it is easier to find the inverse of this rotational component (trust us) So we’ll digress for a moment and focus our attention on the inverse of the normalizing transformation, which is called the viewing transformation. The viewing transformation turns the canonical view into the arbitrary view, or (x, y, z) to (u, v, n) Viewing Transformation Normalizing Transformation

10 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 9/42 We know the view specification: Position, Look vector, and Up vector We need to derive an affine transformation from these parameters that will translate and rotate the canonical view into our arbitrary view –the scaling of the film (i.e. the cross-section of the view volume) to make a square cross-section will happen at a later stage, as will clipping Translation is easy to find: we want to translate the origin to the point Position; therefore, the translation matrix is Rotation is harder: how do we generate a rotation matrix from the viewing specifications that will turn x, y, z, into u, v, n? –a digression on rotation will help answer this Building Viewing Transformation from View Specification

11 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 10/42 3 x 3 rotation matrices We learned about 3 x 3 matrices that “rigid-body rotate” the world (we’re leaving out the homogeneous coordinate for simplicity) When they do, the three unit vectors that used to point along the x, y, and z axes are moved to new positions Because it is a rigid-body rotation –the new vectors are still unit vectors –the new vectors are still perpendicular to each other –the new vectors still satisfy the “right hand rule” Any matrix transformation that has these three properties is a rotation about some axis by some amount! Let’s call the three x-axis, y-axis, and z-axis-aligned unit vectors e 1, e 2, e 3 Writing out: Rotation (1/5)

12 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 11/42 Let’s call our rotation matrix M and suppose that it has columns v 1, v 2, and v 3 : When we multiply M by e 1, what do we get? Similarly for e 2 and e 3 : Rotation (2/5)

13 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 12/42 Thus, for any matrix M, we know that Me 1 is the first column of M If M is a rotation matrix, we know that Me 1 (i.e., where e 1 got rotated to) must be a unit-length vector (because rotations preserve length) Since Me 1 = v 1, the first column of any rotation matrix M must be a unit vector Also, the vectors e 1 and e 2 are perpendicular… So if M is a rotation matrix, the vectors Me 1 and Me 2 are perpendicular… (if you start with perpendicular vectors and rotate them, they’re still perpendicular) But these are the first and second columns of M … Ditto for the other two pairs As we noted in the slide on rotation matrices in the homogeneous coordinate lecture, for a rotation matrix with columns v i –columns must be unit vectors: ||v i || = 1 –columns are perpendicular: v i v j = 0 (i  j) Rotation (3/5)

14 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 13/42 Therefore (for rotation matrices) We can write this matrix of v i v j dot products as where M T is a matrix whose rows are v 1, v 2, and v 3 Also, for matrices in general, M -1 M = I, (actually, M -1 exists only for “well-behaved” matrices) Therefore, for rotation matrices only we have just shown that M -1 is simply M T M T is trivial to compute, M -1 takes considerable work: big win! Rotation (4/5)

15 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 14/42 Summary If M is a rotation matrix, then its columns are pairwise perpendicular and have unit length Inversely, if the columns of a matrix are pairwise perpendicular and have unit length and satisfy the right- hand rule, then the matrix is a rotation For such a matrix, Rotation (5/5)

16 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 15/42 Now we know that a rotation matrix is a matrix that will turn perpendicular unit vectors e 1, e 2, and e 3 into new perpendicular unit vectors v 1, v 2, and v 3 Additionally, we know that columns of this matrix will be vectors v 1, v 2, and v 3 Let’s call vectors e 1, e 2, and e 3 the world-space axes x, y, and z, and let’s call vectors v 1, v 2, and v 3 the camera-space unit vector axes u, v, and n Want to build a rotation matrix that will normalize (u, v, n) into (x, y, z). We just found a matrix, M, that will turn (x, y, z) into (u, v, n). Conversely, M -1 =M T turns (u, v, n) into (x, y, z). The rows of M T will just be u, v, and n Reduces the problem of finding the correct rotation matrix into finding the correct perpendicular unit vectors u, v, and n Restatement of rotation problem: find u, v, and n using Position, and the Look vector and Up vector, then applying M T to get the x, y, z unit vectors e 1, e 2, e 3 Building the Orientation Matrix

17 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 16/42 We know that the (u, v, n) axes we want will have the properties that –our arbitrary Look Vector will lie along the negative n- axis –a projection of the Up Vector into the plane perpendicular to the n-axis will lie along the v-axis –The u-axis will be mutually perpendicular to the v and n- axes, and will form a right-handed coordinate system Plan of attack: first find n from Look, then find u from n and Up, then find v from n and u Finding u, v, and n from Position, Look, and Up (1/6)

18 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 17/42 Finding n Finding n is easy. Look vector in canonical volume lies on –z. Since z maps to n, n is a normalized vector pointing in the opposite direction from our arbitrary Look vector Note that Up and Look define a plane, and that we will define v to lie in that plane perpendicular to n = -Look, and that u is normal to that plane. Look Up n v u Finding u, v, and n (2/6)

19 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 18/42 Finding u The constraints on u are: –1. must be perpendicular to plane spanned by n-axis and Up vector –2. (u, Up, n) must form a right-handed (though not mutually perpendicular) coordinate system To satisfy (1), we can use cross-product, but which one should we use? –n X Up and Up X n are both perpendicular to the plane, but in different directions... Answer: cross-products are right-handed, so use Up X n to satisfy (2) as well –Use the cross-product applet to convince yourself that “order matters” in cross-product: Applets->Linear Algebra->Cross Product Problem: orientation of u-axis constrained by v and n- axes... But we don’t have v-axis yet. Solution: use Up vector instead of v-axis. The only problem with this is that (u, Up, n) will not necessarily form an orthogonal basis, i.e., mutually perpendicular and unit vectors (because Up is at an arbitrary angle to n). We’ll correct this later. Finding u, v, and n (3/6) Look Up n v u

20 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 19/42 Finding u, cont’d. So, the formula is: Note: n is unit length, but Up vector might not be unit length or perpendicular to n, so we had to normalize u Problem: what happens if Up and n are parallel? Answer: the length ||Up x n|| is zero, which means we would divide by 0 in the above equation. Bad stuff, don’t let it happen! –try it out on the applet As a reminder, the cross product of two vectors a and b is: Finding u, v, and n (4/6) Look Up n v u

21 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Look Up n v u Andries van Dam September 22, 2005 3D Viewing III 20/42 Finding v Finding v is just as easy as finding u; v must be perpendicular to u and n, and (u, v, n) must be a right-handed coordinate system Again using right hand rule: Do not need to normalize v... why? Since n and u are unit length and mutually perpendicular, then their cross product is also unit length (see the applet!). From previous slide, we currently have (u, Up, n) but this coordinate system is not mutually perpendicular Finding u, v, and n (5/6)

22 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 21/42 To summarize The viewing transformation is now fully specified –knowing u, v, and n, we can rotate the canonical view into the user- specified orientation –we already know how to translate the view Important: Note that we don’t actually apply the forward viewing transformation. Instead, the inverse viewing transformation, namely the normalizing transformation, will be used to map the arbitrary view into the canonical view Finding u, v, and n (6/6) Look Up n v u

23 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S The Viewing Problem for Parallel Projection Given a parallel view specification and vertices of a bunch of objects, we use the normalizing transformation, i.e., the inverse viewing transformation, to normalize the view volume to a cuboid at the origin, then clip, and then project by ignoring z The Viewing Problem for Perspective Projection Normalize the perspective view specification to a unit frustum at the origin looking down the –z axis; then transform the perspective view volume into a parallel (cuboid) view volume, simplifying both clipping and projection Andries van Dam September 22, 2005 3D Viewing III 22/42 Transforming to the Canonical View (1, 1, 0) Note: it’s a cuboid, not a cube (makes transformation arithmetic and clipping easy)

24 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 23/42 The Parallel Case Decomposes into multiple steps Each step defined by a matrix transformation The product of these matrices defines the whole transformation in one, more “complex,” composite matrix. The steps are: –move the eye/camera to the origin –transform the view so that (u, v, n) is aligned with (x, y, z) –adjust the scales so that the view volume fits between –1 and 1 in x and y, the back clip plane lies at z = –1, the front plane at z = 0 The Perspective Case Same as parallel, but add one more step: –distort pyramid to cuboid to achieve perspective distortion to align the front clip plane with z = 0 Steps for Normalizing View Volume

25 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 24/42 Get the eye to the origin We want a matrix that will take (Pos x, Pos y, Pos z ) to (0, 0, 0) Solution: it’s just the inverse of the translation we found for producing the viewing transform translation (t x, t y, t z ) = (–Pos x, –Pos y, –Pos z ) We will take the matrix: and we will multiply all vertices explicitly (and the camera implicitly) to preserve relationship between camera and scene, i.e., for all vertices p This will move Position to (0, 0, 0) Perspective (1/4)

26 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Position now at origin But we’re hardly done! Still need to: align orientation with x,y,z world coordinate system normalize proportions of the view volume Andries van Dam September 22, 2005 3D Viewing III 25/42 The Current Situation

27 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 26/42 Rotate the view and align with the world coordinate system We found out that the view transformation matrix M with columns u, v, and n would rotate the x, y, z axes into the u, v, and n axes We now apply inverse (transpose) of that rotation, M T, to scene. That is, a matrix with rows u, v, and n will rotate the axes u, v, and n into the axes x, y, and z Now every vertex in the scene (and the camera implicitly) get multiplied by the composite matrix We’ve translated and rotated, so that the Position is at the origin, and the (u, v, n) coordinates and the (x, y, z) coordinates are aligned Perspective (2/4) Look current situation

28 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 27/42 We’ve gotten things more or less to the right place, but the proportions of the view volume need to be normalized. Last affine transformation: scaling Adjust so that the corners of far clipping plane eventually lie at (+1, +1, –1) One mathematical operation works for both parallel and perspective view volumes Imagine vectors emanating from origin passing through corners of far clipping plane. For perspective view volume, these are edges of volume. For parallel, these lie inside view volume First step: force vectors into 45-degree angles with x and y axes We’ll do this by scaling in x and y Perspective (3/4)

29 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Scaling Clipping Planes Looking down from above, we see this: Want to scale in x to make angle 90 degrees Need to scale in x by Similarly in y Andries van Dam September 22, 2005 3D Viewing III 28/42 Perspective (4/4)

30 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 29/42 The scale matrix we need looks like this: So our current composite transformation looks like this: The xy scaling matrix

31 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 30/42 Relative proportions of view volume planes now correct, but back clipping plane probably lying at some z  –1 We need to shrink the back plane to be at z = –1 The z distance from the eye to that point has not changed: it’s still far (distance to far clipping plane) If we scale in z only, proportions of volume will change; instead we’ll scale uniformly: One more scaling matrix

32 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Far plane at z = –1. Near clip plane now at z = –k (note k > 0) bbbbbbbbbbbbbAndries van Dam September 22, 2005 3D Viewing III 31/42 The Current Situation z y x (-k,k,-k) (-1,1,-1) z = -1

33 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 32/42 Our near-final composite normalizing transformation for canonical perspective view volume is Exactly the same tricks suffice to get the parallel view volume to the canonical one The Results

34 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 33/42 We’ve put the perspective view volume into canonical position, orientation and size Let’s look at a particular point on the original near clipping plane lying on the Look vector: It gets moved to a location on the negative z-axis, say The Perspective Transformation (1/5) p = Position + (near) Look

35 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S What is the value of k? Trace through the steps. p first gets moved to just (near)Look This point is then rotated to (near)(–e 3 ) The xy scaling has no effect, and the xyz scaling changes this to, so –but far is –1, so -near/far is simply near Andries van Dam September 22, 2005 3D Viewing III 34/42 The Perspective Transformation (2/5)

36 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 35/42 We now transform the points in the standard perspective view volume between –k and –1 into the standard parallel view volume The “z-buffer,” used for visible surface calculation, needs the z values to be [0 1], not [–1 0]. So the perspective transformation must also transform the scene to the range z = 0 to z = 1 The matrix that does this is just (Remember that 0< k <1 …) The Perspective Transformation (3/5) Note: not 1! Flip the z-axis and unhinge

37 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 36/42 Take a typical point and rewrite it as where ; p is parameterized by distance along frustum –when d = 0, p is on near clip plane; when d = (1-k), p is on far clip plane –depending on x, y, and z, p may or may not actually fall within frustum Apply D (from previous slide) to p to get new point p’ Note: must divide through by !!! –this causes x and y to be “perspectivized”, with points closest to near clip plane being scaled up most –understanding homogenous coordinates is essential for correct viewing The Perspective Transformation (4/5) Try values of d: 0, 1-k, ½(1-k), -1, 1

38 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S The Perspective Transformation (5/5) Andries van Dam September 22, 2005 3D Viewing III 37/42 Again consider What happens to x and y when d gets very large? –note: when we let d increase beyond (1-k), p is now beyond the frustum (such lines will be clipped) This result provides perspective foreshortening: parallel lines converge to a vanishing point What happens when d is negative? –here p is now in front of the near clip plane, possibly behind the eye point (COP) –result: when (k+d) becomes negative, the sign of x and y will be flipped: text would be upside-down and backwards –you won’t see these points because they are clipped What happens after perspective transformation? Answer: parallel projection is applied to determine location of points onto the film plane –projection is easy: drop z! –however, we still need to keep the z ordering intact for visible surface determination

39 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 38/42 Final transformation: Note that once the viewing parameters (Position, Up vector, Look vector, Height angle, Aspect ratio, Near, and Far) are known, the matrices can all be computed and multiplied together to get a single 4x4 matrix that is applied to all points of all objects to get them from “world space” to the standard parallel view volume. This is a huge win for homogeneous coordinates The End Result

40 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 39/42 We said that taking the picture from the canonical view would be easy: final steps are clipping and projecting onto film plane We need to clip scene against sides of view volume However, we’ve normalized our view volume into an axis-aligned cuboid that extends from –1 to 1 in x and y and from 0 to 1 in z Note: This is the flipped (in z) version of the canonical view volume Clipping is easy! Test x and y components of vertices against +/-1. Test z components against 0 and 1 Clipping Back clip plane transforms to the xy plane here Front clip plane transforms to here (1, -1, 1) (-1, -1, 1) (-1, 1, 0) (1, 1, 1) (-1, -1, 0) (1, 1, 0) (1, -1, 0) (-1, 1, 1) x y z

41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Vertices falling within these values are saved, and vertices falling outside get clipped; edges get clipped by knowing x,y or z value at an intersection plane. Substitute x, y, or z = 1 in the corresponding parametric line equations to solve for t In 2D: Andries van Dam September 22, 2005 3D Viewing III 40/42 Clipping (cont.) (x 0, y 0, z 0 ) (x 1, y 1, z 1 ) t=0 t=1 (1, 1) (-1, -1) x y (x 0, y 0 ) (x 1, y 1 ) x=1

42 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S We can make a picture by the simple strategy of taking each point and “ignoring z” to project it onto the xy-plane A point (x,y,z) where turns into the point (x´, y´) in screen space (assuming viewport is the entire screen) with by - ignoring z - If viewport is inside a Window Manager’s window, then we need to scale down and translate to produce “window coordinates” Note: because it’s a parallel projection we could have projected onto the front plane, the back plane, or any intermediate plane … the final pixmap would have been the same Andries van Dam September 22, 2005 3D Viewing III 41/42 Projection 1. Note that these functions are not exactly correct since if x or y is ever 1, then we will get x’ or y’ to be 1024 which is out of our range, so we need to make sure that we handle these cases gracefully. In most cases, making sure that we get the floor of 512(x+1) will address this problem since the desired x will be less than 1.

43 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III 42/42 In summary, the entire problem can be reduced to a composite matrix multiplication of vertices, clipping, and a final matrix multiplication to produce screen coordinates. The final composite matrix (CTM) is the composite of all modeling (instance) transformations (CMTM) accumulated during scene graph traversal from root to leaf, composited with the final composite normalizing transformation N applied to the root/world coordinate system: That’s all there is to it, folks! Summary

44


Download ppt "I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, 2005 3D Viewing III Kansas State University CIS 636 Fundamentals."

Similar presentations


Ads by Google