Updated readability of the code.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / math / Vertex.java
index 0c77868..6e083fc 100644 (file)
@@ -21,14 +21,19 @@ public class Vertex {
 
     /**
      * Vertex coordinate relative to the viewer after transformation.
+     * Visible vertices have positive z coordinate.
+     * Viewer is located at (0, 0, 0).
      */
     public Point3D transformedCoordinate;
 
     /**
-     * Vertex coordinate on screen after transformation.
+     * Vertex coordinate in pixels relative to the top left corner of the screen after transformation.
      */
     public Point2D onScreenCoordinate;
 
+    /**
+     * The frame number when this vertex was last transformed.
+     */
     private int lastTransformedFrame;
 
     public Vertex() {
@@ -43,14 +48,16 @@ public class Vertex {
         onScreenCoordinate = new Point2D();
     }
 
+
     /**
-     * Transforms the coordinate.
+     * Transforms vertex coordinate to calculate its location relative to the viewer.
+     * It also calculates its location on the screen.
      *
-     * @param transforms The transforms pipeline.
-     * @param renderContext The rendering context.
+     * @param transforms Transforms pipeline.
+     * @param renderContext Rendering context.
      */
-    public void transform(final TransformsPipeline transforms,
-                          final RenderingContext renderContext) {
+    public void calculateLocationRelativeToViewer(final TransformsStack transforms,
+                                                  final RenderingContext renderContext) {
 
         if (lastTransformedFrame == renderContext.frameNumber)
             return;