From 41505dada82315a321f778f81e56b66ab77382e3 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Mon, 1 Nov 2021 11:14:59 +0000 Subject: [PATCH] Render a triangle Co-authored-by: sigonasr2 --- src/sig/SigRenderer.java | 6 +++--- src/sig/Triangle.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/sig/Triangle.java diff --git a/src/sig/SigRenderer.java b/src/sig/SigRenderer.java index 4477bec..48f80aa 100644 --- a/src/sig/SigRenderer.java +++ b/src/sig/SigRenderer.java @@ -6,7 +6,7 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; public class SigRenderer implements MouseListener,MouseMotionListener{ - Vector3d vec; + Triangle tri; public final static int SCREEN_WIDTH=1280; public final static int SCREEN_HEIGHT=720; public final static long TIMEPERTICK = 16666667l; @@ -17,8 +17,8 @@ public class SigRenderer implements MouseListener,MouseMotionListener{ } SigRenderer(JFrame f) { - vec = new Vector3d(); - System.out.println(vec); + tri = new Triangle(new Vector3D(),new Vector3D(),new Vector3D()); + System.out.println(tri); Panel p = new Panel(); diff --git a/src/sig/Triangle.java b/src/sig/Triangle.java new file mode 100644 index 0000000..218e0e3 --- /dev/null +++ b/src/sig/Triangle.java @@ -0,0 +1,14 @@ +package sig; + +public class Triangle { + Vector3D A,B,C; + Triangle(Vector3D A,Vector3D B,Vector3D C) { + this.A=A; + this.B=B; + this.C=C; + } + @Override + public String toString() { + return "Triangle [A=" + A + ", B=" + B + ", C=" + C + "]"; + } +}