Đang chuẩn bị liên kết để tải về tài liệu:
3D Graphics with OpenGL ES and M3G- P7

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

3D Graphics with OpenGL ES and M3G- P7:Mobile phones are the new vehicle for bringing interactive graphics technologies to consumers. Graphics that in the 1980s was only seen in industrial flight simulators and at the turn of the millennium in desktop PCs and game consoles is now in the hands of billions of people. This book is about the technology underpinnings of mobile threedimensional graphics, the newest and most rapidly advancing area of computer graphics. | 44 LINEAR ALGEBRA FOR 3D GRAPHICS CHAPTER 2 that x y z must form a right-handed coordinate system. Therefore we can obtain x from u x z also normalized as z was. Finally we get y z x x. In this case we know that z and x are already perpendicular unit vectors so y will also be a unit vector and there is no need to normalize it except to perhaps make sure no numerical error has crept in . Note the order of the cross products they must follow a circular order so that x x y produces z y x z produces x and z x x produces y. 2.5 PROJECTIONS After the scene has been transformed to the eye coordinates we need to project the scene to the image plane of our camera. Figure 2.8 shows the principle of perspective projection. We have placed the eye at the origin so that it looks along the negative z axis with the image plane at z -1. A point Y Z is projected along the projector aline connecting the point to the center of projection the origin intersecting the image plane at Y -1 . From similar triangles we see that Y -Y Z. We can also see that this model incorporates the familiar perspective foreshortening effect an object with the same height but being located further away appears smaller as illustrated by the second narrower projector . The projection matrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -1 0 2.33 performs this projection. Let us check with x X Y Z 1 T Px X Y Z which after the homogeneous division by the last component becomes -Z T -X Z -Y Z - 1 . This is the projected point on the plane z -1. Figure 2.8 Perspective camera projection. Objects that are farther away appear smaller. SECTION 2.5 PROJECTIONS 45 2.5.1 NEAR AND FAR PLANES AND THE DEPTH BUFFER Equation 2.33 loses information namely the depth as all objects are projected to the same z -1 plane. We could try to retain the depth order by sorting objects based on their depths and drawing them in a back-to-front order this is called the Painter s Algorithm . However it may not be possible to sort the objects especially if .