< Zurück | Inhalt | Weiter >

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


Cone defines a simple Cone Primitive with 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 Cone is 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 Cone similarly to a Cylinder, except without a top cap.


Cone consists of the following Shape3D objects:


ALIGN="JUSTIFY">int BODY = 0;

"JUSTIFY">int CAP = 1;

image


Figure 8.3


image

The Cone Primitive (low resolution)


Figure 8.4


The Cone Primitive (high resolution)


By default, 15 surfaces are generated for the sides of the Cone. This can be increased or decreased by using the most customizable constructor:


public Cone(float radius, float height, int primflags, int xdivision, int ydivision, Appearance ap)


The geometry for the Cone consists of a Cylinder tapering from the supplied radius at one end to zero radius at the other end. A disk is created using the same number of divisions as the Cylinder and aligned to close the open end of the Cylinder.