Class BorderLine
java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.slicer.BorderLine
Represents an edge (border line) of a triangle in the polygon slicing pipeline.
A BorderLine connects two Vertex endpoints and carries an
identification count used by the Slicer to determine which edge
of the original triangle this line corresponds to (1, 2, or 3). This identification
is essential for correct recursive subdivision -- when the longest edge is split,
the slicer uses the count to decide how to partition the triangle into two
smaller triangles.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe edge identifier (1, 2, or 3) indicating which edge of the original triangle this border line represents. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleComputes the 3D Euclidean distance between the two endpoint vertices.Computes the midpoint vertex of this edge by averaging both the 3D coordinates and the 2D texture coordinates of the two endpoints.voidSets the endpoints and edge identifier for this border line.
-
Field Details
-
count
public int countThe edge identifier (1, 2, or 3) indicating which edge of the original triangle this border line represents. Used bySlicerduring recursive subdivision.
-
-
Constructor Details
-
BorderLine
public BorderLine()Creates an uninitialized border line for reuse.
-
-
Method Details
-
set
Sets the endpoints and edge identifier for this border line.- Parameters:
c1- the first vertex endpointc2- the second vertex endpointcount- the edge identifier (1, 2, or 3)
-
getLength
public double getLength()Computes the 3D Euclidean distance between the two endpoint vertices.- Returns:
- the length of this edge in world-space units
-
getMiddlePoint
Computes the midpoint vertex of this edge by averaging both the 3D coordinates and the 2D texture coordinates of the two endpoints.- Returns:
- a new
Vertexat the midpoint, with interpolated texture coordinates
-