SPHEREMAP mode

The SPHERE_MAP mode is very different from the OBJECT_LINEAR or EYE_LINEAR modes in that it always generates 2D s,t texture coordinates irrespective of any mapping planes passed to the TexCoordGeneration constructor. The SPHERE_MAP mode calculates texture coordinates based on the vector passing from the origin in world coordinates to a vertex. It creates a mapping that essentially paints an environment map onto the face of an object. Imagine that the object was a reflective sphere positioned in...

SharedGroup and link

The SharedGroup Node defines a scenegraph management Node that can be attached to several parent Nodes. The SharedGroup itself can be arbitrarily complex but must occur as a whole as a Leaf Node within the scenegraph. A SharedGroup must be wrapped in an instance of a Link object before being added to the scenegraph. The Link must have one unique parent. SharedGroups cannot contain the following Nodes

Material

--javax.media.j3d.SceneGraphObject --javax.media.j3d.Material Table 9.3 Capability bits for the Material class OpenGL Reference glColorMaterial, glMaterial The Material class specifies surface rendering characteristics table 9.3 using the following parameters Lighting enable Controls whether lighting is enabled for the Shape3D. Shininess Gloss parameter that controls the effect of specular lighting. The effects of the various colors specified within the Material are described in detail in the...

Lights 1

Careful use of lights can make the difference between a flat, unconvincing 3D scene and an atmospheric, immersive virtual reality. The shading that results from applying lighting to a 3D scene provides many of the important visual cues that convey the depth information for the scene. There are four basic types of light defined in Java 3D and most 3D rendering APIs Ambient lights Applied to the whole scene. Directional lights Positioned at infinity and shine in a given direction. Point lights...

Comparing output

Look at the outputs from MyJava3D and Java 3D again figure 2.4 . They are very different so Java 3D must be doing a lot more than projecting points and drawing lines Triangles are drawn filled you cannot see the edges of the triangles. Nice lighting effect can be seen in the curve of the hand. Background colors are different. Performance is much better measured by comparing the number of frames rendered per second. Figure 2.4 Compare the output from Java 3D left with the output from MyJava3D...

From RasterTestjava

size of the window, and hence size of the depth component array private static int m_kWidth 300 private static int m_kHeight 300 the Raster used to store depth components private Raster m_DepthRaster null the Raster used to render an image into the 3D view private Raster m_RenderRaster null an array of integer values for the depth components private int m_DepthData null create the image to be rendered using a Raster BufferedImage bufferedImage new BufferedImage 128, 128,...

EYELINEAR mode

The EYE_LINEAR texture coordinate generation mode is very similar to the OBJECT_LINEAR mode with one important difference. The positions of vertices in their local coordinate system are no longer used rather the positions of vertices in the world coordinate system are used instead. This has major consequences as the landscape is moved within the VirtualUniverse, the texture coordinates of the vertices within the landscape are recomputed, for example, in the TexCoordTest example, by simply...

PickShapes

PickShapes are used by the PickTool to provide information about the volume of space, segment, or infinite ray that the objects in the scene should be tested against. Java 3D supports the PickShapes listed in table 16.1 Table 16.1 PickShapes supported by Java 3D Table 16.1 PickShapes supported by Java 3D PickBounds is a finite pick shape defined with a Bounds object. PickConeRay is an infinite cone ray pick shape. PickConeSegment is a finite cone segment pick shape. PickCylinderRay is an...

Dynamic mapping using TexCoordGeneration

In contrast to a hard-coded static mapping between vertex coordinates and texture coordinates, dynamic texture mapping enables the application developer to define a mapping that is resolved by the renderer at runtime. Dynamic mapping is fairly unusual but is very useful for certain scientific visualization applications where the position of a vertex in 3D space should correlate with its texture coordinate. Rather than having to manually update the texture coordinate whenever a vertex moves, the...