3D Graphics with OpenGL ES and M3G- P38: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. | 354 THE M3G SCENE GRAPH CHAPTER 15 excess data will always use up memory for no good reason. This applies to data such as texture coordinates and vertex colors as well if you have no use for some piece of data drop it before putting it into the M3G format. Next let us figure out how to move the objects around in the World. TRANSFORMING OBJECTS Remember how in immediate mode rendering you had to pass in a modeling transformation for each rendering call In the scene graph all you have to do is to move the objects themselves. Let us move the meshes we created in the previous section Node is derived from Transformable which provides you with the functions for setting various transformation components as discussed in Section translation T rotation R scale S and an arbitrary 4 x 4 matrix M. These are combined into a single composite transformation in each node C TRSM For scene graph Node objects there is an additional restriction that the bottom row of the matrix component must be 0 0 0 1 in other words the W component will retain its value of 1 in all scene graph node transformations. There is normally no need for projective transformations in this context so supporting them would unnecessarily complicate M3G implementations. Querying transformations In addition to the getters for each of the transformation components you can also query the composite transformation C directly. To do this call Transformable. getCompositeTransform Transform transform . Upon return transform will contain the composite transformation matrix. This is usually faster than combining the individual components in Java code. The node transformations are concatenated hierarchically within the scene graph. If you have a Group with a Mesh inside it the composite world-space transformation of the Mesh object is Cmesh-to-world CgroupCmesh where Cgroup and Cmesp .