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 12 triangular polygons (2 per face,
covering all 6 faces). Each face is rendered as a pair of
SolidPolygon
triangles with the same color.
The box can be constructed either from a center point and a uniform size (producing a cube), or from two diagonally opposite corner points (producing an arbitrary axis-aligned rectangular box).
The vertices are labeled p1 through p8, representing the eight corners of the box. The triangles are arranged to cover the bottom, top, front, back, left, and right faces.
Usage example:
// From center and size:
SolidPolygonRectangularBox box1 = new SolidPolygonRectangularBox(
new Point3D(0, 0, 200), 100, Color.RED);
// From two corner points:
SolidPolygonRectangularBox box2 = new SolidPolygonRectangularBox(
new Point3D(-50, -25, 100), new Point3D(50, 25, 200), Color.BLUE);
shapeCollection.addShape(box1);
- See Also:
-
Field Summary
Fields inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
mouseInteractionController -
Constructor Summary
ConstructorsConstructorDescriptionSolidPolygonRectangularBox(Point3D p1, Point3D p7, Color color) Constructs a solid rectangular box between two diagonally opposite corner points in 3D space. -
Method Summary
Methods inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape
addShape, addShape, beforeTransformHook, getGroup, getLocation, getOriginalSubShapes, getViewSpaceTracker, hideGroup, removeGroup, setBackfaceCulling, setColor, setGroupForUngrouped, setLightingManager, setMouseInteractionController, setShadingEnabled, setTransform, showGroup, transform
-
Constructor Details
-
SolidPolygonRectangularBox
Constructs a solid rectangular box between two diagonally opposite corner points in 3D space. The eight vertices of the box are derived from the coordinate components ofp1andp7. All six faces are tessellated into two triangles each, for a total of 12 solid polygons.- Parameters:
p1- the first corner point (minimum coordinates by convention)p7- the diagonally opposite corner point (maximum coordinates)color- the fill color applied to all 12 triangular polygons
-