3D Graphics with OpenGL ES and M3G- P21

3D Graphics with OpenGL ES and M3G- P21: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. | 184 OPENGL ES TRANSFORMATION AND LIGHTING CHAPTER 8 The mode must be one of GL_MODELVIEW GL_PROJECTION or GL_TEXTURE. In this section we concentrate on the modelview and projection matrices texture transformations are discussed in Section . From OpenGL ES onward GL_MATRIX_ PALETTE_OES is also optionally available see Section . The color matrix that exists in OpenGL is not supported. All matrices are 4 x 4 matrices and are stored in column-first order. The current matrix can be replaced by calling void glLoadMatrix fx const T m where m is an array of 16 floating-point or fixed-point numbers ordered as follows m 0 m 4 m 8 m 12 m 1 m 5 m 9 m 13 m 2 m 6 m 10 m 14 m 3 m 7 m 11 m 15 It is possible to multiply a new matrix with the current matrix using void glMultMatrix fx const T m . If C is the current matrix calling glMultMatrix with M computes C CM that is the multiplication is from the right side. As described in Chapter 2 it is often useful to separately transform the vertices from the object coordinates to the world coordinates and then transform the vertices from the world coordinates to the eye coordinates. The matrices can then be used as follows GLfloat world_to_eye_matrix 16 object_to_world_matrix 16 calculate matrices set up modelview matrix and draw glMatrixMode GL_MODELVIEW glLoadMatrixf world_to_eye_matrix glMultMatrixf object_to_world_matrix glDrawArrays GL_TRIANGLES 0 n The convenience function void glLoadIdentity void replaces the current matrix with the identity matrix see Equation while the following functions void glTranslate fx t x T y T z void glRotate fx t angle T x T y T z void glScale fx t x T y T z SECTION VERTEX TRANSFORMATION PIPELINE 185 multiply the current matrix with one of Equations and . The functions void glFrustum fx t left T right T bottom T top T near T far void glOrtho fx t left T right T bottom T top T near T far are used to set up the perspective projection matrix of Equation or .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.