Package eu.svjatoslav.sixth.e3d.math
Class Vertex
java.lang.Object
eu.svjatoslav.sixth.e3d.math.Vertex
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 Summary
Modifier and TypeFieldDescriptionVertex coordinate in 3D space.Vertex coordinate in pixels relative to the top left corner of the screen after transformation and perspective correction.Coordinate within texture.Vertex coordinate relative to the viewer after transformation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateLocationRelativeToViewer
(TransformsStack transforms, RenderingContext renderContext) Transforms vertex coordinate to calculate its location relative to the viewer.
-
Field Details
-
coordinate
Vertex coordinate in 3D space. -
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
Vertex coordinate in pixels relative to the top left corner of the screen after transformation and perspective correction. -
textureCoordinate
Coordinate within texture.
-
-
Constructor Details
-
Vertex
public Vertex() -
Vertex
-
Vertex
-
-
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.
-