1. Npm : 201243501128
Nama : Kiuntoro
Kelas : R7H
Mata Kuliah : Komputer Grafik
Dosen : Nahot Frastian , M.Kom
Program Studi : Teknik Informatika
Universitas : Universitas Indraprasta Pgri
Program Komputer Grafik :
- Soal1a
Input :
import java.awt.Graphics ;
public class soal1a extends java.applet.Applet {
public void paint ( Graphics g ) {
int xvalues [] = {180,30,180,330};
int yvalues [] = {30,185,330,185};
g.drawPolygon (xvalues,yvalues,xvalues.length);
g.drawOval ( 30 , 30 , 300 , 300 ) ;
g.drawRect (82,133,196,100);
2. int xvalues2 [] = {180,120,180,240};
int yvalues2 [] = {150,185,218,185};
g.drawPolygon (xvalues2,yvalues2,xvalues2.length);
}
}
Proses :
drawPolygon dengan pergabungan xvalues= 180,30,180,330 dengan y values=
30,185,330,185
drawRect : kordinat x1 nya 82 , x2 nya = 133 , y1 = 196 , y2 = 100
drawOval : kordinat x1 nya 30 , x2 nya = 30 , y1 = 300 , y2 = 300
drawPolygon yang kedua dengan pergabungan xvalues= 180,120,180,240
dengan y values= 150,185,218,185