Figure 8.5 The Cylinder Primitive int BODY
The Sphere Primitive (low resolution) Figure 8.7 The Sphere Primitive (high resolution) Figure 8.8 Sphere Primitive with an applied texture image of the Earth 8.2.5 Primitive flags All of the Primitiveshave a primitive flags (primflags) argument in one of their constructors. Primitive flags influence the attributes applied to the Shape3Dgeometry when it is generated internally for the Primitive. The available primitive flags are shown in table 8.1. Table 8.1 Primitive flags for Primitive derived classes Primitive flag Effect ENABLE_APPEARANCE_MODIFY Set ALLOW_APPEARANCE_READ and ALLOW_APPEARANCE_WRITE capabilities on the generated geometry’s Shape3D nodes. ENABLE_GEOMETRY_PICKING Set ALLOW_INTERSECT capability on the generated geometry. GENERATE_NORMALS Generate normal vectors along with geometry. GENERATE_NORMALS_INWARD Normal vectors flipped along the surface. GENERATE_TEXTURE_COORDS Generate texture coordinates along with geometry. GEOMETRY_NOT_SHARED Generate geometry that will not be shared by another scene graph node. After a Primitivehas been generated, the capabilities for the Shape3Dsubparts can also be accessed by calling getShape(partid).setCapability(ALLOW_INTERSECT); Note that the setPrimitiveFlagsmethod should not be used, as it does not have any effect once the Primitivehas been created. Unless primitive flags are explicitly supplied, the default GENERATE_NORMALSprimitive flag is used. In other words, both vertex coordinates and normal vectors are generated (to allow surfaces to be lighted). 115
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services