projects
/
sixth-3d.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated readability of the code.
[sixth-3d.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
sixth
/
e3d
/
math
/
Vertex.java
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java
b/src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java
index
0c77868
..
6e083fc
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java
@@
-21,14
+21,19
@@
public class Vertex {
/**
* Vertex coordinate relative to the viewer after transformation.
/**
* Vertex coordinate relative to the viewer after transformation.
+ * Visible vertices have positive z coordinate.
+ * Viewer is located at (0, 0, 0).
*/
public Point3D transformedCoordinate;
/**
*/
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;
*/
public Point2D onScreenCoordinate;
+ /**
+ * The frame number when this vertex was last transformed.
+ */
private int lastTransformedFrame;
public Vertex() {
private int lastTransformedFrame;
public Vertex() {
@@
-43,14
+48,16
@@
public class Vertex {
onScreenCoordinate = new Point2D();
}
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 T
he t
ransforms pipeline.
- * @param renderContext
The r
endering context.
+ * @param transforms Transforms pipeline.
+ * @param renderContext
R
endering context.
*/
*/
- public void
transform(final TransformsPipeline
transforms,
- final RenderingContext renderContext) {
+ public void
calculateLocationRelativeToViewer(final TransformsStack
transforms,
+
final RenderingContext renderContext) {
if (lastTransformedFrame == renderContext.frameNumber)
return;
if (lastTransformedFrame == renderContext.frameNumber)
return;