Skip to content

Commit

Permalink
Credit update 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Emery Ferrari committed May 9, 2020
1 parent b3f4e46 commit 34b66a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/com/emeryferrari/jse3d/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void paintComponent(Graphics graphics) {
}
for (int a = 0; a < scene.object.length; a++) {
Point[] points = new Point[scene.object[a].points.length];
// WRITTEN BY SAM START
for (int i = 0; i < scene.object[a].points.length; i++) {
double zAngle = Math.atan((scene.object[a].points[i].z)/(scene.object[a].points[i].x));
if (scene.object[a].points[i].x == 0 && scene.object[a].points[i].z == 0) {
Expand Down Expand Up @@ -164,6 +165,7 @@ public void paintComponent(Graphics graphics) {
camScale.get(a).set(i, distance.get(a).get(i).distance*Math.cos(theta)*Math.sin(scene.viewAngle/2));
points[i] = new Point((int)(frame.getWidth()/2+xTransform/camScale.get(a).get(i)), (int)(frame.getHeight()/2-yTransform/camScale.get(a).get(i)));
}
// WRITTEN BY SAM END
if (renderPoints) {
if (invertColors) {
graphics.setColor(Color.WHITE);
Expand Down

0 comments on commit 34b66a1

Please sign in to comment.