//enable lighting and assign material m.setLightingEnable(true); ap.setMaterial(m); //render
//enable lighting and assign material m.setLightingEnable(true); ap.setMaterial(m); //render the Box as a wire frame PolygonAttributes polyAttrbutes = new PolygonAttributes(); polyAttrbutes.setPolygonMode( PolygonAttributes.POLYGON_LINE ); polyAttrbutes.setCullFace(PolygonAttributes.CULL_NONE); ap.setPolygonAttributes(polyAttrbutes); //create the box and assign the appearance Box BoxObj = new Box(1.5f, 1.5f, 0.8f, Box.GENERATE_NORMALS | Box.GENERATE_TEXTURE_COORDS, ap); //load and assign a texture image and set texture parameters TextureLoader tex = new TextureLoader(”texture.jpg”, “RGB”, this); if (tex != null) ap.setTexture(tex.getTexture()); TextureAttributes texAttr = new TextureAttributes(); texAttr.setTextureMode(TextureAttributes.MODULATE); ap.setTextureAttributes(texAttr); 8.2.2 Cone java.lang.Object | +–javax.media.j3d.SceneGraphObject | +–javax.media.j3d.Node | +–javax.media.j3d.Group | +–com.sun.j3d.utils.geometry.Primitive | +–com.sun.j3d.utils.geometry.Cone Conedefines a simple ConePrimitivewith a radius and a height, illustrated in figures 8.3 and 8.4. It is a capped cone centered at the origin with its central axis aligned along the Y-axis. The center of the Coneis defined to be the center of its bounding box (rather than its centroid). If the GENERATE_TEXTURE_COORDS flag is set, the texture coordinates are generated so that the texture gets mapped onto the Conesimilarly to a Cylinder, except without a top cap. Coneconsists of the following Shape3Dobjects: ALIGN=”JUSTIFY”>int BODY = 0; “JUSTIFY”>int CAP = 1; 112
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services