tailieunhanh - 3D Graphics with OpenGL ES and M3G- P6
3D Graphics with OpenGL ES and M3G- P6: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. | 34 LINEAR ALGEBRA FOR 3D GRAPHICS CHAPTER 2 coordinates see Section MweMow takes a vertex from object coordinates to eye coordinates. Notice the order of application v Mowv is applied first followed by v Mwev MweMowV. A compound transformation can in principle be evaluated in two orders. You can do it from right to left Mwe Mowv that is transform the vertex through each of the coordinate systems one at a time or from left to right MweMow v that is collapse the transformations into one before applying them to the vertex. Let us now analyze which order is more efficient. If you take the first approach repeatedly transforming each vertex you will need 16mn multiplications where m is the number of transformations and n the number of vertices. If you take the second approach you need 64 m - 1 multiplications to collapse the matrices and 16n multiplications to apply the transformation to each vertex. Therefore if 64 m - 1 16n 16mn it makes sense to compound the matrices before applying the result to the vertices. For example if you have 20 points and 3 transformations the approach of transforming each point 3 times would require 16 3 20 960 multiplications while first combining the transformations and then applying them would only require 64 3 - 1 16 20 448 multiplications. You can see that it almost always makes more sense to collapse the transformations before applying them to the vertices. Repeating this analysis for the number of additions rather than multiplications only changes the constant factors in the above inequality from 64 to 48 and from 16 to 12 thus not changing the outcome in a significant way. TRANSFORMING NORMAL VECTORS Even though vectors in general are transformed the same way as points normal vectors must be transformed differently. Normal vectors are not just any direction vectors they are defined by the surface so that a normal vector is perpendicular to the surface. If M is used to transform the surface then normals must be transformed .
đang nạp các trang xem trước