//the color cube with the left mouse button
//the color cube with the left mouse button MouseRotate mouseRot = new MouseRotate( subTg ); subTg.addChild( mouseRot ); //assign a transformChanged callback, because we want //to be notified whenever the rotation of the ColorCube changed //(”this” implements MouseBehaviorCallback ); mouseRot.setupCallback( this ); mouseRot.setSchedulingBounds( getApplicationBounds() ); transTg.addChild( subTg ); return transTg; } //this is a callback method that the MouseRotate behavior calls //when its Transform3D has been modified (by the user) public void transformChanged(int type, Transform3D transform) { //update the rotation of the TextureAttributes m_TextureAttributes.setTextureTransform( transform ); } 14.5 Using transparent geometry with transparent texture images The Textureclass allows texture images to have red, green, blue, and alpha (transparency) channels through the RGBA mode. Appearances(and hence geometry) can also have transparency information, either through per-vertex COLOR_4colors, or through the TransparencyAtttributes NodeComponent. Figures 14.25 14.27 illustrate what happens when partially transparent images are applied to partially transparent Shape3Ds. The easiest way to use transparent images is to use the GIF image format, which can include a transparent color. Most bitmap editors, such as JASC PaintShop Pro or Adobe Photoshop, can save GIF images with a transparent color. Figures 14.25 14.27 were generated using the AppearanceTestexample application. The Boxhad the appearance attributes shown on table 14.5. Table 14.5 Box appearance attributes Transparency: 0.5, NICEST Material: Ambient = white, Diffuse = white, Emissive = blue, Specular = black, Shininess = 1 Texture: MagFilter = BASE_LEVEL_LINEAR, MinFilter = MULTI_LEVEL_LINEAR MIPMAPs were enabled. The front face (smaller) of the cube uses per-vertex colors with transparency and hence is unaffected by the overall TransparencyAttributes of the Box s Appearance. Figure 14.25 is provided for contrast; it uses the opaque texture image (texture0n.jpg). 256
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services