Class Vertex

java.lang.Object
eu.svjatoslav.sixth.e3d.math.Vertex

public class Vertex extends Object
Vertex is a point where two or more lines, line segments, or rays come together. In other words, it's a corner of a polygon, polyhedron, or other geometric shape. For example, a triangle has three vertices, a square has four, and a cube has eight.
  • Field Details

    • coordinate

      public Point3D coordinate
      Vertex coordinate in 3D space.
    • transformedCoordinate

      public Point3D transformedCoordinate
      Vertex coordinate relative to the viewer after transformation. Visible vertices have positive z coordinate. Viewer is located at (0, 0, 0). No perspective correction is applied.
    • onScreenCoordinate

      public Point2D onScreenCoordinate
      Vertex coordinate in pixels relative to the top left corner of the screen after transformation and perspective correction.
    • textureCoordinate

      public Point2D textureCoordinate
      Coordinate within texture.
  • Constructor Details

    • Vertex

      public Vertex()
    • Vertex

      public Vertex(Point3D location)
    • Vertex

      public Vertex(Point3D location, Point2D textureCoordinate)
  • Method Details

    • calculateLocationRelativeToViewer

      public void calculateLocationRelativeToViewer(TransformsStack transforms, RenderingContext renderContext)
      Transforms vertex coordinate to calculate its location relative to the viewer. It also calculates its location on the screen.
      Parameters:
      transforms - Transforms pipeline.
      renderContext - Rendering context.