Fastest pixel blitting renderer being created in Java. 3D renderer. For educational purposes and most importantly, FUN
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package sig;
|
|
|
|
import java.awt.Color;
|
|
|
|
|
|
|
|
public class Triangle {
|
|
|
|
Vector A,B,C;
|
|
|
|
Color col = Color.WHITE;
|
|
|
|
public Triangle() {
|
|
|
|
this(new Vector(),new Vector(),new Vector());
|
|
|
|
}
|
|
|
|
public Triangle(Vector A,Vector B,Vector C) {
|
|
|
|
this.A=A;
|
|
|
|
this.B=B;
|
|
|
|
this.C=C;
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
protected Object clone(){
|
|
|
|
return new Triangle((Vector)this.A.clone(),(Vector)this.B.clone(),(Vector)this.C.clone());
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Triangle [A=" + A + ", B=" + B + ", C=" + C + "]";
|
|
|
|
}
|
|
|
|
public Color getColor() {
|
|
|
|
return col;
|
|
|
|
}
|
|
|
|
public void setColor(Color col) {
|
|
|
|
this.col=col;
|
|
|
|
}
|
|
|
|
}
|