資源簡介
1)理解并掌握Cohen-SutherLand 算法的編碼思想;
3. 實驗要求
1)將像素網格表現出來,建立網格坐標系;
2)用橡皮筋的形式輸入剪裁線段和裁剪窗口;
3)鼠標移動時,顯示鼠標當前位置;
4)對于線段裁剪,線段被窗口的四條邊裁剪的過程要顯示出來;
6)裁剪過程可以重復進行。

代碼片段和文件信息
//---------------------------------------------------------------------------
#include?
#pragma?hdrstop
//---------------------------------------------------------------------------
USEFORM(“Unit1.cpp“?Form1);
//---------------------------------------------------------------------------
WINAPI?WinMain(HINSTANCE?HINSTANCE?LPSTR?int)
{
????????try
????????{
?????????????????Application->Initialize();
?????????????????Application->CreateForm(__classid(TForm1)?&Form1);
?????????????????Application->Run();
????????}
????????catch?(Exception?&exception)
????????{
?????????????????Application->ShowException(&exception);
????????}
????????catch?(...)
????????{
?????????????????try
?????????????????{
?????????????????????????throw?Exception(““);
?????????????????}
?????????????????catch?(Exception?&exception)
?????????????????{
?????????????????????????Application->ShowException(&exception);
?????????????????}
????????}
????????return?0;
}
//---------------------------------------------------------------------------
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3579??2010-06-22?23:32??截圖直線段Sutherland\Project1.bpr
?????文件???????1069??2010-05-29?12:18??截圖直線段Sutherland\Project1.cpp
?????文件?????131072??2010-06-22?23:31??截圖直線段Sutherland\Project1.exe
?????文件??????17898??2010-06-22?23:31??截圖直線段Sutherland\Project1.obj
?????文件??????99908??2010-06-22?23:31??截圖直線段Sutherland\Project1.res
?????文件????2031616??2010-06-22?23:32??截圖直線段Sutherland\Project1.tds
?????文件???????3579??2010-06-22?23:30??截圖直線段Sutherland\Project1.~bpr
?????文件??????14621??2010-06-02?18:45??截圖直線段Sutherland\Unit1.cpp
?????文件?????????51??2010-06-22?23:32??截圖直線段Sutherland\Unit1.ddp
?????文件????????906??2010-06-22?23:31??截圖直線段Sutherland\Unit1.dfm
?????文件???????1518??2010-06-02?15:23??截圖直線段Sutherland\Unit1.h
?????文件??????56734??2010-06-22?23:31??截圖直線段Sutherland\Unit1.obj
?????文件??????14621??2010-06-02?18:45??截圖直線段Sutherland\Unit1.~cpp
?????文件?????????51??2010-06-22?23:30??截圖直線段Sutherland\Unit1.~ddp
?????文件?????218970??2010-06-22?23:30??截圖直線段Sutherland\Unit1.~dfm
?????文件???????1518??2010-06-02?15:23??截圖直線段Sutherland\Unit1.~h
?????文件????????102??2010-06-24?20:56??readme.txt
?????目錄??????????0??2010-06-23?00:37??截圖直線段Sutherland
-----------?---------??----------?-----??----
??????????????2597813????????????????????18
評論
共有 條評論