Archive for August, 2007

Web design service - Figure 9.29 Coloring = null, Ambient: white, Diffuse:

Friday, August 31st, 2007

Figure 9.29 Coloring = null, Ambient: white, Diffuse: white, Emissive: blue, Transparency = 0.5 SCREEN_DOOR. No problems apparent here 9.13 Summary Java 3D provides you with a rich set of capabilities for controlling the appearance of your geometry. By combining aspects of the Appearanceclass, such as materials, transparency, textures, or rendering attributes, you can achieve visually effective scenes with very little programming. The high-level object-oriented API allows you to easily navigate through the dozens of appearance capabilities and is a real productivity improvement over a lower-level API such as OpenGL. In some areas (for example, transparency), however, it can be important to understand what is going on under the covers, as Java 3D does a poor job at insulating you from the peculiarities of the underlying implementation or providing adequate documentation. If you require additional information I strongly recommend a good 3D graphics text as well as an OpenGL/DirectX reference. 149
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

Figure 9.27 Coloring = null, Material = null. (Web host music)

Friday, August 31st, 2007

Figure 9.27 Coloring = null, Material = null. Transparency = 0.8 SCREEN_DOOR. We have increased the transparency of the Box and rotated it so that the QuadArray is now at the rear of the Box. Using SCREEN_DOOR transparency, the QuadArray has now disappeared Figure 9.28 Coloring = null, Ambient: white, Diffuse: white, Emissive: blue, Transparency = 0.5 NICEST. The scene renders correctly but continuously renders, cycling over the back faces and then redrawing the front faces 148
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Web site developers - Figure 9.25 Coloring = null, Material = null.

Thursday, August 30th, 2007

Figure 9.25 Coloring = null, Material = null. Transparency = 0.5 SCREEN_DOOR. Using stippling to simulate transparency is not as realistic as using true color blending Figure 9.26 Coloring = null, Material = null. Transparency = 0.8 NICEST. We have increased the transparency of the Box and rotated it so that the QuadArray is now at the rear of the Box. No problems apparent here 147
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Figure 9.23 Coloring = null, Material = (Web hosting directory) null.

Thursday, August 30th, 2007

Figure 9.23 Coloring = null, Material = null. Transparency = 0 SCREEN_DOOR. Here, when we switch to SCREEN_DOOR transparency, the rendering order problem disappears Figure 9.24 Coloring = null, Material = null. Transparency = 0.5 NICEST. When the Box is semitransparent, the problem with rendering order is not apparent because you can see the QuadArray through the Box 146
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Figure 9.21 Coloring = null, Ambient: white Diffuse: (Web hosting support)

Wednesday, August 29th, 2007

Figure 9.21 Coloring = null, Ambient: white Diffuse: white Emissive: blue, Transparency = null. Lighting is now active and affects the QuadArray with per-vertex colors Figure 9.22 Coloring = null, Material = null. Transparency = 0 NICEST. Here we have set up transparency for both the Box (100% opaque) and the QuadArray (per-vertex transparency). Even though the QuadArray should be visible at the front of the Box, it is being rendered behind the Box. This would be a case that could be solved using a simple sorting algorithm because the centroid of the Box is behind the centroid of the QuadArray and hence it should be rendered before the QuadArray 145
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Figure 9.19 Coloring = null, Material = null, (Web hosting domains)

Wednesday, August 29th, 2007

Figure 9.19 Coloring = null, Material = null, Transparency = null Figure 9.20 Coloring = green, Material = null, Transparency = null. Note that the QuadArray with per-vertex colors is unaffected 144
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Web design rates - float[] tcoords = { 1, 0, 1, 1,

Wednesday, August 29th, 2007

float[] tcoords = { 1, 0, 1, 1, 0, 1, 0, 0 }; //define the normal vector for the new left face Vector3f normalVector = new Vector3f(-1.0f, 0.0f, 0.0f); //assign the colors to the QuadArray geometry.setColors( 0, colors, 0, 4 ); //assign the normal vector for each vertex in the QuadArray for( int n = 0; n <4; n++ ) geometry.setNormal( n, normalVector ); //assign the texture coordinates for each vertex in the QuadArray geometry.setTextureCoordinates( 0, tcoords, 0, 4 ); //finally, assign the vertices themselves into the QuadArray geometry.setCoordinates( 0, verts ); All rendering was performed with NOTE PolygonAttributes.CULL_NONE; so all the faces of the Box were rendered. 9.12.1 A warning about transparency Consider carefully what you are trying to achieve if you choose to use transparency as an Appearance attribute in your scene. It is very difficult to know exactly what will be rendered by Java 3D in either NICEST or SCREEN_DOOR mode, and without some form of application-specific sorting algorithm, which must be carried out potentially on every frame, problems will probably occur. The issues with transparency really do not reside at the Java3D level, but Java 3D has not done a good job of insulating the Java 3D developer from the underlying issues in the OpenGL/DirectX implementation. I am hopeful that Sun can address many of these issues in Java 3D 1.3. 143
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

course view-dependent. The problem therefore becomes (Free web hosts) one of

Tuesday, August 28th, 2007

course view-dependent. The problem therefore becomes one of sorting geometry from front to back before rendering takes place. For general scenes this is extremely difficult, especially for scenes that are composed of overlapping or interpenetrating objects. Such objects will have to be decomposed into nonpenetrating subsections before rendering. Without sorting, you will only get reasonable results if most of your objects are opaque and you have only a few, nonoverlapping, transparent surfaces. The Java 3D rendering order is as follows: 1. Opaque objects 2. Ordered objects (OrderedGroups) 3. Transparent objects Within the opaque and transparent groups no sorting is performed. Therefore, transparent objects will overlap opaque or ordered objects in front of them, whereas, because transparent objects are not depth-sorted, there are no guarantees that transparent objects will be rendered correctly. Figures 9.19 through 9.29 illustrate some of the potential rendering problems. The scene for the following figures was composed of a single Boxprimitive with one face (LEFT) removed. The LEFTface was replaced with a new, slightly smaller face that included per-vertex colors (COLOR_4). The code used to replace the LEFTface follows: //create a Box with Normal vectors and texture coordinates Box box = new Box(nScale,nScale,nScale, Primitive.GENERATE_NORMALS | Primitive.GENERATE_TEXTURE_COORDS, m_Appearance ); Shape3D frontFace = box.getShape( Box.LEFT ); //create a new left face so we can assign per-vertex colors GeometryArray geometry = new QuadArray( 4, GeometryArray.COORDINATES | GeometryArray.NORMALS | GeometryArray.COLOR_4 | GeometryArray.TEXTURE_COORDINATE_2 ); nScale = 40; //define the geometry for the left face final float[] verts = { -1.0f * nScale, -1.0f * nScale, 1.0f * nScale, -1.0f * nScale, 1.0f * nScale, 1.0f * nScale, -1.0f * nScale, 1.0f * nScale, -1.0f * nScale, -1.0f * nScale, -1.0f * nScale, -1.0f * nScale }; //define the colors for the left face. Note we are using RGBA //colors and include per-vertex transparency final float[] colors = { 1,0,0,0, 0,1,0,0.2f, 0,0,1,0.8f, 0,0,0,1, }; //define the texture coordinates for the left face 142
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Using transparency slows rendering considerably (Kids web site) because the renderer

Tuesday, August 28th, 2007

Using transparency slows rendering considerably because the renderer must track the transparency of every pixel in the frame. Without transparency the color of a pixel in the frame is dictated by the color of the geometry closest to the viewer. All other geometry that would be mapped into the frame pixel location can be discarded since it is occluded by the geometry closest to the viewer. If some of the elements in the scenegraph are transparent, however, the renderer must perform a sequence of complex blending operations between the colors generated for a single pixel in the frame. Figure 9.18 Five Sphere primitives with varying transparency, from left to right 100%, 70%, 50%, 30%, and 10%. All of the Spheres have the same color (black) Here is what the Microsoft/Silicon Graphics OpenGL reference says about using transparency: Transparency is best implemented using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)with primitives sorted from farthest to nearest. Note that this transparency calculation does not require the presence of alpha bitplanes in the frame buffer. You can also use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)for rendering antialiased points and lines in arbitrary order. The key phrase in the description is, with primitives sorted from farthest to nearest. This is where the problems with using transparency in Java 3D occur. Because transparency is a Shape3Dobject attribute, Java 3D users naturally assume that they merely have to set the object or vertex transparency and Java 3D will take care of everything else. Sadly, this is not the case, as Java 3D provides very little support for sorting the primitives from farthest to nearest. This should be changing however, as Java 3D 1.3 will implement depth-sorted transparency as demonstrated as a Sun presentation at the JavaOne 2001 conference. Traditional 3D rendering techniques rely on the Z-buffer to ensure objects nearer to the viewer are rendered on top of objects further away. The Z-buffer is essentially an array of depth values, one element in the array for each pixel in the frame. As the scene is rendered, the Z-buffer is updated with the distance of the source location for each pixel from the viewer. The Color buffer tracks the color of the closest source location for each pixel in the frame, as shown in the following sequences: Rendering for Surface 1 Prerender pixel at location 5,10. Get depth to geometry for pixel (10 meters). Update Z-buffer with depth to geometry and update Color buffer with color of pixel. Rendering for Surface 2 Prerender pixel at location 5,10. Get depth to geometry for pixel (15 meters). Do not update Z-buffer as 15 > 10 and do not update Color buffer as pixel is not closer to viewer. In this way, when all the geometry in the scene has been prerendered, the Z-buffer contains the depth values for each pixel to the nearest geometry and the Color buffer contains the color for each pixel. When transparency is used, however, the color of a pixel cannot be solely determined from the color of the closest geometry; instead, a complex blend of the colors of all geometry gets mapped to the pixel location. In general, the blending will only be calculated correctly if the geometry is rendered from back to front, which is of 141
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Web design online - BLEND_COLOR MODE TRANSFORM OpenGL Reference: glTexParameter Java 3D s

Monday, August 27th, 2007

BLEND_COLOR MODE TRANSFORM OpenGL Reference: glTexParameter Java 3D s texture capabilities (table 9.11) are discussed in detail in chapter 14. 9.11 Texture java.lang.Object | +–javax.media.j3d.SceneGraphObject | +–javax.media.j3d.NodeComponent | +–javax.media.j3d.Texture Table 9.12 Capability bits for the Texture class BOUNDARY_COLOR ENABLE FILTER IMAGE MIPMAP_MODE OpenGL Reference: glTexImage2D. Java 3D s texture capabilities (table 9.12) are discussed in detail in chapter 14. 9.12 TransparencyAttributes java.lang.Object | +–javax.media.j3d.SceneGraphObject | +–javax.media.j3d.NodeComponent | +–javax.media.j3d.TransparencyAttributes Table 9.13 Capability bits for the TransparencyAttributes class MODE VALUE OpenGL Reference: glBlendFunc The TransparencyAttributesclass allows the transparency of objects to be specified. Transparency is set using an Alpha value (table 9.13). Alpha values range from 0.0, representing complete opacity, to 1.0, representing complete transparency. Like color, transparency can either be set on a per-vertex basis or, by using the TransparencyAttributesclass, for an entire Shape3D. Per-vertex transparency (set using COLOR_4per-vertex colors) takes precedence over the transparency value specified in the Shape3D s TransparencyAttributes. The examples to follow will help to illustrate this. Transparency should be used with care, because, as the OpenGL reference indicates, it is a blending operation between pixels that have their source geometry located at different positions within the scene. 140
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.