Class SolidPolygonCone
The cone has a circular base and a single apex (tip) point. Two constructors are provided for different use cases:
- Directional (recommended): Specify apex point and base center point. The cone points from apex toward the base center. This allows arbitrary orientation and is the most intuitive API.
- Y-axis aligned: Specify base center, radius, and height. The cone points in -Y direction (apex at lower Y). Useful for simple vertical cones.
Usage examples:
// Directional constructor: cone pointing from apex toward base
SolidPolygonCone directionalCone = new SolidPolygonCone(
new Point3D(0, -100, 0), // apex (tip of the cone)
new Point3D(0, 50, 0), // baseCenter (cone points toward this)
50, // radius of the circular base
16, // segments
Color.RED
);
// Y-axis aligned constructor: cone pointing upward
SolidPolygonCone verticalCone = new SolidPolygonCone(
new Point3D(0, 0, 300), // baseCenter
50, // radius
100, // height
16, // segments
Color.RED
);
- See Also:
-
Field Summary
Fields inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
mouseInteractionController -
Constructor Summary
ConstructorsConstructorDescriptionSolidPolygonCone(Point3D baseCenter, double radius, double height, int segments, Color color) Constructs a solid cone with circular base centered at the given point, pointing in the -Y direction.SolidPolygonCone(Point3D apexPoint, Point3D baseCenterPoint, double radius, int segments, Color color) Constructs a solid cone pointing from apex toward base center. -
Method Summary
Methods inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape
addShape, addShape, beforeTransformHook, extractSolidPolygons, getGroup, getLocation, getOriginalSubShapes, getViewSpaceTracker, hideGroup, removeGroup, setBackfaceCulling, setColor, setGroupForUngrouped, setMouseInteractionController, setShadingEnabled, setTransform, showGroup, transform
-
Constructor Details
-
SolidPolygonCone
public SolidPolygonCone(Point3D apexPoint, Point3D baseCenterPoint, double radius, int segments, Color color) Constructs a solid cone pointing from apex toward base center.This is the recommended constructor for placing cones in 3D space. The cone's apex (tip) is at
apexPoint, and the circular base is centered atbaseCenterPoint. The cone points in the direction from apex to base center.Coordinate interpretation:
apexPoint- the sharp tip of the conebaseCenterPoint- the center of the circular base; the cone "points" in this direction from the apex- The distance between apex and base center determines the cone height
- Parameters:
apexPoint- the position of the cone's tip (apex)baseCenterPoint- the center point of the circular base; the cone points from apex toward this pointradius- the radius of the circular basesegments- the number of segments around the circumference. Higher values create smoother cones. Minimum is 3.color- the fill color applied to all faces of the cone
-
SolidPolygonCone
public SolidPolygonCone(Point3D baseCenter, double radius, double height, int segments, Color color) Constructs a solid cone with circular base centered at the given point, pointing in the -Y direction.This constructor creates a Y-axis aligned cone. The apex is positioned at
baseCenter.y - height(above the base in the negative Y direction). For cones pointing in arbitrary directions, useSolidPolygonCone(Point3D, Point3D, double, int, Color)instead.Coordinate system: The cone points in -Y direction (apex at lower Y). The base is at Y=baseCenter.y, and the apex is at Y=baseCenter.y - height. In Sixth 3D's coordinate system, "up" visually is negative Y.
- Parameters:
baseCenter- the center point of the cone's circular base in 3D spaceradius- the radius of the circular baseheight- the height of the cone from base center to apexsegments- the number of segments around the circumference. Higher values create smoother cones. Minimum is 3.color- the fill color applied to all faces of the cone
-