資源簡介
z-buffer算法進階是掃描線算法,再進一步就是區間掃描線算法,這是圖形學基本算法。這里面是vs2015的項目,里面附贈了多個obj模型。先從obj模型讀取開始,到最后的顯示。

代碼片段和文件信息
#include?
#include?“Vec.h“
#include?“utils.h“
#include?“Model.h“
#include?“SectionScanLine.h“
#include?“Render.h“
#include?
using?namespace?std;
string?path?=?“../models“;
vector?fileNames;
string?getfilename()?{
fileNames?=?getListFiles(path?“*.obj“);
cout?<“choose?one:\n**************************“?< for?(int?i?=?0;?i? {
cout?< }
cout?<“**************************“?< cout?<“choose?now:“;
int?fileID;
while?(true)?{
cin?>>?fileID;
if?(fileID?>=?fileNames.size()?||?fileID?<=?0)
cout?<“choose?errortry?again:“?< else
return?fileNames[fileID?-?1];
}
}
int?main()
{
//?讀取模型
string??fileName?=?path?+?“/“+?getfilename();
Model?model(fileName);
//窗口大小
int?width?=?1000?height?=?800;
SectionScanLine?sectionScanLine;
sectionScanLine.setSize(width?height);
//?運行算法
sectionScanLine.start(model);
Render?render(&model?§ionScanLine);
render.display();
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-28?14:09??section_z-buffer\
?????目錄???????????0??2017-12-13?17:41??section_z-buffer\.vs\
?????目錄???????????0??2017-12-07?20:55??section_z-buffer\.vs\ScanLineZBuffer\
?????目錄???????????0??2017-12-07?20:55??section_z-buffer\.vs\ScanLineZBuffer\v14\
?????文件???????61952??2017-12-07?17:02??section_z-buffer\.vs\ScanLineZBuffer\v14\.suo
?????目錄???????????0??2017-12-08?09:39??section_z-buffer\.vs\SectionScanLineZbuffer\
?????目錄???????????0??2017-12-08?09:39??section_z-buffer\.vs\SectionScanLineZbuffer\v14\
?????文件???????62464??2017-12-28?14:09??section_z-buffer\.vs\SectionScanLineZbuffer\v14\.suo
?????目錄???????????0??2017-12-14?20:41??section_z-buffer\Debug\
?????文件??????356352??2017-12-07?21:08??section_z-buffer\Debug\ScanLineZBuffer.exe
?????文件?????1518732??2017-12-07?21:08??section_z-buffer\Debug\ScanLineZBuffer.ilk
?????文件?????3166208??2017-12-07?21:08??section_z-buffer\Debug\ScanLineZBuffer.pdb
?????文件??????360960??2017-12-13?17:33??section_z-buffer\Debug\ScanLineZBuffer_modi.exe
?????文件?????1305372??2017-12-13?17:33??section_z-buffer\Debug\ScanLineZBuffer_modi.ilk
?????文件?????6696960??2017-12-13?17:33??section_z-buffer\Debug\ScanLineZBuffer_modi.pdb
?????文件??????323584??2017-12-15?12:51??section_z-buffer\Debug\SectionScanLineZbuffer.exe
?????文件?????1445528??2017-12-15?12:51??section_z-buffer\Debug\SectionScanLineZbuffer.ilk
?????文件?????3534848??2017-12-15?12:51??section_z-buffer\Debug\SectionScanLineZbuffer.pdb
?????目錄???????????0??2017-12-15?12:51??section_z-buffer\ScanLineZBuffer\
?????目錄???????????0??2017-12-15?12:51??section_z-buffer\ScanLineZBuffer\Debug\
?????文件??????462774??2017-12-13?11:10??section_z-buffer\ScanLineZBuffer\Debug\Display.obj
?????文件??????669759??2017-12-14?20:41??section_z-buffer\ScanLineZBuffer\Debug\Model.obj
?????文件???????61372??2017-12-13?18:54??section_z-buffer\ScanLineZBuffer\Debug\Rasterizer.obj
?????文件??????102792??2017-12-15?12:51??section_z-buffer\ScanLineZBuffer\Debug\Render.obj
?????目錄???????????0??2017-12-13?17:33??section_z-buffer\ScanLineZBuffer\Debug\ScanLine.E16269B4.tlog\
?????文件????????5306??2017-12-13?17:33??section_z-buffer\ScanLineZBuffer\Debug\ScanLine.E16269B4.tlog\CL.command.1.tlog
?????文件???????85124??2017-12-13?17:33??section_z-buffer\ScanLineZBuffer\Debug\ScanLine.E16269B4.tlog\CL.read.1.tlog
?????文件????????8458??2017-12-13?17:33??section_z-buffer\ScanLineZBuffer\Debug\ScanLine.E16269B4.tlog\CL.write.1.tlog
?????文件?????????212??2017-12-13?17:33??section_z-buffer\ScanLineZBuffer\Debug\ScanLine.E16269B4.tlog\ScanLineZBuffer_modi.lastbuildstate
?????文件????????2512??2017-12-13?17:33??section_z-buffer\ScanLineZBuffer\Debug\ScanLine.E16269B4.tlog\li
?????文件????????5472??2017-12-13?17:33??section_z-buffer\ScanLineZBuffer\Debug\ScanLine.E16269B4.tlog\li
............此處省略75個文件信息
- 上一篇:學生評語管理系統3.5
- 下一篇:污水處理系統自控系統設計
評論
共有 條評論