Render a triangle

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 3 years ago
parent 982384af66
commit 41505dada8
  1. 6
      src/sig/SigRenderer.java
  2. 14
      src/sig/Triangle.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();

@ -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 + "]";
}
}
Loading…
Cancel
Save