Báo cáo bài tập lớn môn Đồ Hoạ - Đồ hoạ phẳng và Đồ hoạ không gian - pdf 27

Download miễn phí Báo cáo bài tập lớn môn Đồ Hoạ - Đồ hoạ phẳng và Đồ hoạ không gian



Đồ hoạ máy tính là một trong các lĩnh vực mà ngành tin học quan tâm và đã được đưa vào chương trình đào tạo chính khoá cho ngành tin học tại các trường Đại học. Nội dung chủ yếu của môn học là nghiên cứu các thuật toán, các kỹ thuật vẽ hình trên máy tính, giúp sinh viên có thể xây dựng các phần mềm về đồ hoạ máy tính.
 Là sinh viên Cao đẳng tin học, chúng em cũng được tiếp xúc làm quen với một số kỹ thuật đồ hoạ trên máy vi tính thông qua các bài giảng và giáo trình do Thày Dương Viết Thắng biên soạn. Với kiến thức còn nhiều hạn chế nên ở đề tài này mục tiêu của chúng em chủ yếu là vận dụng một số kiến thức học được đưa vào vận dụng thực tế thông qua bài tập lớn.
 





Để tải tài liệu này, vui lòng Trả lời bài viết, Mods sẽ gửi Link download cho bạn ngay qua hòm tin nhắn.

Ket-noi - Kho tài liệu miễn phí lớn nhất của bạn


Ai cần tài liệu gì mà không tìm thấy ở Ket-noi, đăng yêu cầu down tại đây nhé:
Nhận download tài liệu miễn phí

Tóm tắt nội dung tài liệu:


edure Chu_Bong(c,h,Font,Huong,KThuoc,Mauc,Maub,v:Integer;Tde:string);
Procedure Beep;
Procedure Chu_Chay;
Procedure About;
Procedure Gwrite(Var c,h:Integer;St:String);
Procedure Gwriteln(Var c,h:Integer;St:String);
Procedure Gread(Var c,h:Integer;Var luu:String);
Procedure Greadln(Var c,h:Integer;Var luu:String);
Procedure Cuaso(C1,H1,C2,H2,Mau_tr,Mau_d,Mau_n,V:Integer);
Procedure Menu_doc(K:Integer);
Procedure Menu_Ngang(K:Integer);
Procedure Projec(x,y,z:real;Var XProj,YProj:real);
Procedure KGMoveto(x,y,z:real);
Procedure KGPutPixel(x,y,z:real;color:byte);
Procedure KGLineto(x,y,z:real;Color:byte);
Procedure KGLine(x1,y1,z1,x2,y2,z2:real;color:byte);
Procedure KG_WriteXYZ(X,Y,Z:real;St:String;color:byte);
Procedure Vetruc(D:integer;Color:byte);
Procedure ProjecP(x,y,z:real;Var XProj,YProj:real);
Procedure KGMovetoP(x,y,z:real);
Procedure KGPutPixelP(x,y,z:real;color:byte);
Procedure KGLinetoP(x,y,z:real;Color:byte);
Procedure KGLineP(x1,y1,z1,x2,y2,z2:real;color:byte);
Procedure KG_WriteXYZP(X,Y,Z:real;St:String;color:byte);
Procedure VetrucP(D:integer;Color:byte);
Implementation
Uses Crt,graph;
Procedure MhDoHoa;
var Gd,Gm,ktra:integer;
Path:String;
Begin
Path:='c:\Tp\Bgi';
Repeat
Gd:=detect; InitGraph(Gd,Gm,Path);
Ktra:=GraphResult;
If Ktra 0 then
Begin
Write('Loi do hoa! Go lai Path, Neu quen thi Enter!');
Readln(Path);
if Path='' then Halt(1);
end;
Until Ktra=0;
end;
{**********************}
Procedure Chu_Bong(c,h,Font,Huong,KThuoc,Mauc,Maub,v:Integer;Tde:string);
Var I:Integer;
Begin
SetTextStyle(Font,Huong,Kthuoc);
SetColor(Maub);
for i:=1 to v do
OutTextXY(C+i,H-i,Tde);
SetColor(Mauc);OutTextXY(c,h,Tde);
end;
{******************************}
Procedure Beep;
Begin
Sound(450);
Delay(100);
Nosound;
end;
{***********************************}
Procedure Chu_Chay;
var cc,cc1:Integer;
St,st1:String;
Ch:Char;
Begin
Cc:=1;Cc1:=cc-340;
St:='Chuong trinh do nhom G2 thuc hien ';
St1:='Giao vien huong dan: Duong Viet Thang ';
Repeat
SetColor(15);
OutTextXY(cc,470,St);
SetColor(10);
OutTextXY(cc1,470,St1);
Delay(100);
SetColor(0);
OutTextXY(cc,470,St);
OutTextXY(cc1,470,St1);
Cc:=Cc+5;
Cc1:=Cc1+5;
If Cc>= 640 then Cc:=1;
If Cc1>= 640 then Cc1:=1;
Until KeyPressed;
end;
{***********************************}
Procedure AboutNen;
Begin
C1:=10;H1:=10;H2:=470;
Cuaso(c1,h1,C1+620,H1+450,15,7,9,5);
{ Chu_Bong(c1+50,h1,8,0,5,Lightred,cyan,5,'TRUONG DHBK HA NOI');
Chu_Bong(C1+190,h1+50,8,0,4,Lightred,cyan,4,'KHOA CNTT');}
Chu_Bong(C1+90,h1+30,7,0,4,14,cyan,3,'BAI TAP LON MON');
Chu_Bong(C1+260,h1+80,7,0,4,14,cyan,3,'KY THUAT DO HOA');
Chu_Bong(C1+50,H1+170,4,0,4,10,lightred,3,'GIAO VIEN: DUONG VIET THANG');
Chu_Bong(c1+10,h1+230,7,0,4,10,lightred,3,'THUC HIEN: NHOM G2');
Chu_Bong(C1+280,H1+250,15,0,4,14,cyan,2,'');
cuaso(c1+228,h1+280,c1+410,h1+412,15,8,lightblue,6);
SetColor(10);OutTextxy(C1+200,H1+430,'PRESS ENTER TO RETURN MAINMENU');
OutTextXY(C1+240,H1+300,'1.DAO VAN DAT (CAP)');
OutTextXY(C1+240,H1+320,'2.NGUYEN CAO DAI');
OutTextXY(C1+240,H1+340,'3.TRINH BUI CHUNG');
OutTextXY(C1+240,H1+360,'4.DINH MINH DUC');
OutTextXY(C1+240,H1+380,'5.TRUONG CONG CHUONG');
End;
{**********************************}
Procedure About;
Begin
ClearDevice;
SetBkColor(0);
Beep;
Delay(50);
Beep;
AboutNen;
Chu_Chay;
Readln;
ClearDevice;
end;
{*****************************}
Procedure Gwrite(Var c,h:Integer;St:String);
Begin
OutTextxy(c,h,st);
C:=c+TextWidth(st);
end;
{*************************************}
Procedure Gwriteln(Var c,h:Integer;St:String);
Var L:Integer;
Begin
L:=10;
OutTextxy(c,h,st);
c:=L;
h:=h+TextHeight('A')+10;
end;
{*********************************}
Procedure Gread(Var c,h:Integer;Var luu:String);
Var ch:char;
Begin
Ch:=' ';
Luu:=' ';
repeat
Ch:=readkey;
If ch #13 then
begin
Gwrite(c,h,ch);
luu:=luu+ch;
end;
Until ch=#13;
End;
{*********************************}
Procedure Greadln(Var c,h:Integer;Var luu:String);
Var ch:char;
Begin
Ch:=' ';
Luu:=' ';
repeat
Ch:=readkey;
If ch #13 then
begin
Gwrite(c,h,ch);
luu:=luu+ch;
end;
Until ch=#13;
C:=10;
h:=h+10;
end;
{*********************************}
Procedure Cuaso(C1,H1,C2,H2,Mau_tr,Mau_d,Mau_n,V:Integer);
Var I:integer;
Begin
For I:=1 to v do
Begin
SetColor(Mau_tr);
Line(C1+i,H1+i,C2-i,H1+i);
Line(C1+i,H1+i,C1+i,H2-i);
SetColor(Mau_d);
Line(C1+i,H2-i,C2-i,H2-i);
Line(C2-i,H2-i,C2-i,H1+i);
end;
{Ve Nen }
setFillStyle(1,Mau_n);
Bar(C1+v,H1+V,C2-V,H2-V);
End;
{**************************}
Procedure Menu_Ngang(K:Integer);
Var Ten_Muc:array[1..3] of string;
I,Rong,Cao,a,b:integer;
Begin
Ten_Muc[1]:=' Program';
Ten_Muc[2]:=' About ';
Ten_Muc[3]:=' Quit';
a:=20;b:=20;Rong:=200;Cao:=30;
For i:=1 to 3 do
Begin
If i=k then CuaSo(a+(i-1)*Rong,b,a+i*rong,b+Cao,8,15,7,4)
Else CuaSo(a+(i-1)*Rong-1,b,a+i*Rong,b+Cao,15,8,7,4);
SetColor(14);
OutTextxy(a+(i-1)*rong+10,b+10,Ten_Muc);
End;
End;
{*******************************}
Procedure Menu_doc(K:Integer);
Var Ten_Muc:array[1..6] of string;
I,Rong,Cao,a,b:integer;
Begin
Ten_Muc[1]:='Do thi bac3/bac1';
Ten_Muc[2]:='Do thi tham so';
Ten_Muc[3]:='Do thi do cuc';
Ten_Muc[4]:='Round Star';
Ten_Muc[5]:='Da dien deu';
a:=20;b:=50;Rong:=150;Cao:=30;
For i:=1 to 5 do
Begin
If i=k then CuaSo(a,b+(I-1)*Cao,a+Rong,b+i*Cao,8,white,3,4)
Else CuaSo(a,b+(i-1)*Cao-1,a+Rong,b+i*Cao,15,8,9,4);
SetColor(10);
OutTextxy(a+10,b+(i-1)*Cao+10,Ten_Muc);
End;
End;
Procedure Projec(x,y,z:real;Var XProj,YProj:real);
Var Xobs,Yobs,Zobs:real;
Aux1,Aux2,Aux3,Aux4,Aux5,Aux6,Aux7,Aux8:real;
th,ph:real;
Begin
th:=Pi*theta/180;
Ph:=Pi*Phi/180;
Aux1:=sin(th);
Aux2:=sin(ph);
Aux3:=cos(th);
Aux4:=cos(ph);
Aux5:=Aux3*Aux2;
Aux6:=Aux1*Aux2;
Aux7:=Aux3*Aux4;
Aux8:=Aux1*Aux4;
XObs:=-x*Aux1+Y*Aux3;
YObs:=-x*Aux5-Y*Aux6+Z*Aux4;
ZObs:=-x*Aux7-Y*Aux8-Z*Aux2+Rho;
If ZObs0 then
begin
XProj:=DE*XObs/ZObs;
YProj:=DE*YObs/ZObs;
end else
begin
XProj:=DE*XObs/0.000001;
YProj:=DE*YObs/0.000001;
end
End;
(*-----------------------------------*)
Procedure KGMoveto(x,y,z:real);
Var Xp,Yp:Real;c,h:integer;
Begin
Projec(x,y,z,Xp,Yp);
C:=CO+round(Xp*Kx);
H:=HO-round(Yp*Ky);
moveto(C,H);
End;
Procedure KGPutPixel(x,y,z:real;color:byte);
Var Xp,Yp:Real;c,h:integer;
Begin
Projec(x,y,z,Xp,Yp);
C:=Co+round(Xp*Kx);
H:=Ho-round(Yp*Ky);
PutPixel(C,H,color);
End;
Procedure KGLineto(x,y,z:real;Color:byte);
Var Xp,Yp:Real;c,h:integer;
Begin
SetColor(color);
Projec(x,y,z,Xp,Yp);
C:=Co+round(XP*Kx);
H:=Ho-round(YP*Ky);
lineto(C,H);
End;
Procedure KGLine(x1,y1,z1,x2,y2,z2:real;color:byte);
Begin
KgMoveto(x1,y1,z1);
KgLineto(x2,y2,z2,color);
End;
Procedure KG_WriteXYZ(X,Y,Z:real;St:String;color:byte);
Var Xp,Yp:Real;c,h:integer;
Begin
Projec(x,y,z,Xp,Yp);
C:=Co+round(XP*Kx);
H:=Ho-round(YP*Ky);
SetColor(color);
OutTextxy(c,h,St);
End;
Procedure Vetruc(D:integer;Color:byte);
Begin
KgMoveto(0,0,0);KgLineto(D,0,0,color);KG_Writexyz(D,0,0,'X',color);
KgMoveto(0,0,0);KgLineto(0,D,0,color);KG_Writexyz(0,D,0,'Y',color);
KgMoveto(0,0,0);KgLineto(0,0,D,color);KG_Writexyz(0,0,D,'Z',color);
End;
(*---------Chieu song song---------------*)
Procedure ProjecP(x,y,z:real;Var XProj,YProj:real);
Var Xobs,Yobs,Zobs:real;
Aux1,Aux2,Aux3,Aux4,Aux5,Aux6,Aux7,Aux8:real;
th,ph:real;
Begin
th:=Pi*theta/180;
Ph:=Pi*Phi/180;
Aux1:=sin(th);
Aux2:=sin(ph);
Aux3:=cos(th);
Aux4:=cos(ph);
Aux5:=Aux3*Aux2;
Aux6:=Aux1*Aux2;
Aux7:=Aux3*Aux4;
Aux8:=Aux1*Aux4;
XObs:=-x*Aux1+Y*Aux3;
YObs:=-x*Aux5-Y*Aux6+Z*Aux4;
ZObs:=-x*Aux7-Y*Aux8-Z*Aux2+Rho;
XProj:=XObs;
YProj:=YObs;
End;
(*-----------------------------------*)
Procedure KGMovetoP(x,y,z:real);
Var Xp,Yp:Real;c,h:integer;
Begin
ProjecP(x,y,z,Xp,Yp);
C:=Co+round(Xp*Kx);
H:=Ho-round(Yp*Ky);
moveto(C,H);
End;
Procedure KGPutPixelP(x,y,z:real;color:byte);
Var Xp,Yp:Real;c,h:integer;
Begin
ProjecP(x,y,z,Xp,Yp);
C:=Co+round(Xp*Kx);
H:=Ho-round(Yp*Ky);
PutPixel(C,H,color);
End;
Procedure KGLinetoP(x,y,z:real;Color:byte);
Var Xp,Yp:Real;c,h:integer;
Begin
SetColor(color);
ProjecP(x,y,z,Xp,Yp);
C:=Co+round(XP*Kx);
H:=Ho-round(YP*Ky);
lineto(C,H);
End;
Procedure KGLineP(x1,y1,z1,x2,y2,z2:real;color:byte);
Begin
KgMovetoP(x1,y1,z1);
KgLinetoP(x2,y2,z2,color);
End;
Procedure KG_WriteXYZP(X,Y,Z:real;St:String;color:byte);
Var Xp,Yp:Real;c,h:integer;
Begin
ProjecP(x,y,z,Xp,Yp);
C:=Co+round(XP*Kx);
H:=Ho-round(YP*Ky);
SetColor(color);
OutTextxy(c,h,St);
End;
Procedure VetrucP(D:integer;Color:byte);
Begin
KgMovetoP(0,0,0);KgLinetoP(D,0,0,color);KG_WritexyzP(D,0,0,'X',white);
KgMovetoP(0,0,0);KgLinetoP(0,D,0,color);KG_Writ...
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status