Program Viewport_Transformasi_Animasi; uses crt, graph;
line((60+p),(10+o),(60-o),(60-o)); line((60-o),(60-o),(10-o),(60-o)); line((10-o),(60-o),(10+p),(10+o)); readln; closegraph; end; end;
var a,b,c,d:real; dr,md,e,f,g,h:integer; mat:array[0..3,0..3] of real;
end;
Procedure Trans(a1,a2,a3,a4,a5,a6,a7,a8,a9:real; q:integer); begin var Repeat amat,bmat:array[0..3] of real; Writeln ('============================='); w,x:real; writeln('|1. Translasi |'); o,p,y,z,i,j:integer; writeln('|2. Scalling |'); begin writeln('|3. Shearing |'); mat[1,1]:=a1; writeln('|4. Viewport |'); mat[1,2]:=a2; writeln('|5. Animasi |'); mat[1,3]:=a3; writeln('|6. Keluar |'); mat[2,1]:=a4; writeln('==========================='); mat[2,2]:=a5; Write('Masukan Pilihan : '); readln(e); mat[2,3]:=a6; clrscr; mat[3,1]:=a7; case e of mat[3,2]:=a8; 1:begin mat[3,3]:=a9; write('Masukan Besar Translasi Untuk x: '); amat[1]:=10; readln(a); amat[2]:=10; write('Masukan Besar Translasi Untuk y: '); amat[3]:=1; readln(b); x:=0; Trans(1,0,0,0,1,0,a,b,1,e); for i:=1 to 3 do end; begin 2:begin for j:=1 to 3 do write('Masukan Besar Scala: '); readln(a); begin Trans(a,0,0,0,a,0,0,0,1,e); w:=(amat[j])*(mat[j,i]); end; x:=(x+w); 3:begin end; write('Masukan Besar Pembebanan Ke Sumbu x: '); bmat[i]:=x; readln(a); x:=0; a:=a/10; end; b:=0; Initgraph(dr,md,'c:\tp\bgi'); Trans(1,a,0,b,1,0,0,0,1,e); line(10,10,60,10); end; line(60,10,60,60); 4:begin line(60,60,10,60); write('Masukan panjang sisi segi empat: '); line(10,60,10,10); readln(f); readln; write('Masukan Panjang Pemotongan Bangun: '); setcolor(yellow); readln(g); case q of Initgraph(dr,md,'c:\tp\bgi'); 1:begin SetViewPort(10, 10,g+10, g+10, ClipOn); o:=round(bmat[1]); rectangle(0, 5, f,f+5); p:=round(bmat[2]); readln; y:=(round(bmat[1]-10))+60; closegraph; z:=(round(bmat[2]-10))+60; end; line(o,p,y,p); 5:begin line(y,p,y,z); InitGraph(dr,md,'c:\tp\bgi'); line(y,z,o,z); f:= 25; line(o,z,o,p); g:= GetMaxY; readln; h:=1; closegraph; end; Repeat 2:begin setcolor(h); o:=(round(bmat[1])-10/2); circle(f ,g div 2,50); p:=(round(bmat[2])-10/2); Delay(250); line((10-o),(10-p),(60+o),(10-p)); ClearDevice; line((60+o),(10-p),(60+o),(60+p)); f:=f+25; line((60+o),(60+p),(10-o),(60+p)); h:=h+1; line((10-o),(60+p),(10-o),(10-o)); Until KeyPressed; readln; closegraph; CloseGraph; end; end; else 3:begin end; o:=((round(bmat[1]))-10); until e=6; p:=((round(bmat[2]))-10); end. line((10+p),(10+o),(60+p),(10+o));