-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFace4d.java
More file actions
47 lines (35 loc) · 794 Bytes
/
Face4d.java
File metadata and controls
47 lines (35 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.awt.Color;
import java.util.ArrayList;
public class Face4d {
//頂点の数は一意ではないのでベクター型にする
//private Vector<Vertex4d> vecV;
private ArrayList<Vertex4d> vecV;
//色
private Color fColor;
public Face4d(Vertex4d[] v) {
this.vecV = new ArrayList<Vertex4d>();
for(Vertex4d vertex: v) {
this.addVertex4d(vertex);
}
fColor = new Color(0,128,0,64);
}
// 頂点の追加
public void addVertex4d(Vertex4d v) {
vecV.add(v);
}
// 頂点の取得
public Vertex4d getVertex4d(int n) {
return vecV.get(n);
}
// 頂点の個数(N角形)
public int getVertexNum() {
return vecV.size();
}
//面の色
public Color getColor() {
return this.fColor;
}
public void setColor(int r,int g,int b, int alpha) {
this.fColor = new Color(r,g,b,alpha);
}
}