Class SolidPolygonRectangularBox
java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.solid.SolidPolygonRectangularBox
- Direct Known Subclasses:
SolidPolygonCube
A solid (filled) rectangular box composed of 6 quadrilateral polygons (1 per face,
covering all 6 faces).
The box is defined by two diagonally opposite corner points in 3D space. The box is axis-aligned, meaning its edges are parallel to the X, Y, and Z axes.
Vertex layout:
cornerB (max) ────────┐
/│ /│
/ │ / │
/ │ / │
┌───┼───────────┐ │
│ │ │ │
│ │ │ │
│ └───────────│───┘
│ / │ /
│ / │ /
│/ │/
└───────────────┘ cornerA (min)
The eight vertices are derived from the two corner points:
- Corner A defines minimum X, Y, Z
- Corner B defines maximum X, Y, Z
- The other 6 vertices are computed from combinations of these coordinates
Usage examples:
// Create a box from two opposite corners
SolidPolygonRectangularBox box = new SolidPolygonRectangularBox(
new Point3D(-50, -25, 100), // cornerA (minimum X, Y, Z)
new Point3D(50, 25, 200), // cornerB (maximum X, Y, Z)
Color.BLUE
);
// Create a cube using center + size (see SolidPolygonCube for convenience)
double size = 50;
SolidPolygonRectangularBox cube = new SolidPolygonRectangularBox(
new Point3D(0 - size, 0 - size, 200 - size), // cornerA
new Point3D(0 + size, 0 + size, 200 + size), // cornerB
Color.RED
);
- See Also:
-
Field Summary
Fields inherited from class AbstractShape
cachedBoundingBox, mouseInteractionController -
Constructor Summary
ConstructorsConstructorDescriptionSolidPolygonRectangularBox(Point3D cornerA, Point3D cornerB, Color color) Constructs a solid rectangular box between two diagonally opposite corner points in 3D space. -
Method Summary
Methods inherited from class AbstractCompositeShape
addShape, addShape, beforeTransformHook, extractSolidPolygons, getBoundingBox, getGroup, getLocation, getSubShapesRegistry, getTransform, getViewSpaceTracker, hideGroup, intersect, removeGroup, setBackfaceCulling, setCacheNeedsRebuild, setColor, setGroupForUngrouped, setMouseInteractionController, setRootComposite, setShadingEnabled, setTransform, showGroup, subtract, transform, unionMethods inherited from class AbstractShape
invalidateBounds
-
Constructor Details
-
SolidPolygonRectangularBox
Constructs a solid rectangular box between two diagonally opposite corner points in 3D space.The box is axis-aligned and fills the rectangular region between the two corners. The corner points do not need to be ordered (cornerA can have larger coordinates than cornerB); the constructor will determine the actual min/max bounds automatically.
- Parameters:
cornerA- the first corner point (any of the 8 corners)cornerB- the diagonally opposite corner pointcolor- the fill color applied to all 6 quadrilateral polygons
-