Class Line
This class represents a line between two 3D points, rendered with a specified width that adjusts based on perspective (distance from the viewer). The line is drawn using interpolators to handle edge cases and alpha blending for transparency effects.
The rendering algorithm: 1. For thin lines (below a threshold), draws single-pixel lines with alpha adjustment based on perspective. 2. For thicker lines, creates four interpolators to define the line's rectangular area and fills it scanline by scanline.
Note: The width is scaled by the LINE_WIDTH_MULTIPLIER and adjusted based on the distance from the viewer (z-coordinate) to maintain a consistent visual size.
-
Field Summary
FieldsModifier and TypeFieldDescriptionColor of the line.final doublewidth of the line.Fields inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape
coordinates, onScreenZ, shapeIdFields inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
mouseInteractionController -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpaint(RenderingContext buffer) Paints this shape onto the rendering context's pixel buffer.Methods inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape
getZ, transformMethods inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
setMouseInteractionController
-
Field Details
-
width
public final double widthwidth of the line. -
color
Color of the line.
-
-
Constructor Details
-
Line
-
Line
-
-
Method Details
-
paint
Description copied from class:AbstractCoordinateShapePaints this shape onto the rendering context's pixel buffer.This method is called after all shapes have been transformed and sorted by depth. Implementations should use the transformed screen-space coordinates from
Vertex.transformedCoordinateto draw pixels.- Specified by:
paintin classAbstractCoordinateShape- Parameters:
buffer- the rendering context containing the pixel buffer and graphics context
-