다각형을 표시 메소드의 일부가 아닌 자체 클래스로 자체 객체로 그려야합니다. 나는 그걸 많이 발견하지 못했고, 누군가 나를 도와 줄 수 있기를 바랍니다.jogl, 자신의 객체/클래스로 폴리곤
public PolygonalGameObject(GameObject parent, double points[],
double[] fillColour, double[] lineColour) {
super(parent);
myPoints = points;
myFillColour = fillColour;
myLineColour = lineColour;
}
public void drawSelf(GL2 gl) {
// TODO: Write this method
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glBegin(GL2.GL_POLYGON);{
for (int i = 0; i < myPoints.length; i += 2) {
double x = myPoints[i];
double y = myPoints[i + 1];
gl.glVertex2d(x, y);
}
}gl.glEnd();
}
게임 오브젝트는 장면 그래프/트리
사람이 좋은 자습서는 다음 게시하시기 바랍니다 있어요 그래서 만약 내가이 (프로그래밍과 그래픽 모두) 꽤 새로운 해요 여러 polygonalGameObjects을 포함하고 있습니다!
많은 감사!