1 / 5
文档名称:

计算机图形学实验报告实验一.docx

格式:docx   大小:31KB   页数:5页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

计算机图形学实验报告实验一.docx

上传人:圭圭 2022/7/13 文件大小:31 KB

下载得到文件列表

计算机图形学实验报告实验一.docx

文档介绍

文档介绍:
计算机图形学实验报告实验一
贵州大学实验报告 学院:
计信学院 专业:
计科 班级:
计科 101 姓名 罗琳 学号 1018060016 实here Algorithm=0;//算法选择 } void CLineDlg::OnRadio() {
// TODO: Add your control notification handler code here Algorithm=2; } void CLineDlg::OnRadio1() { // TODO: Add your control notification handler code here Algorithm=1; } void CLineDlg::OnLinedraw() { // TODO: Add your control notification handler code here CWnd* pWnd=GetDlgItem(IDC_STATIC); CDC* pControlDC=pWnd->GetDC(); pWnd->Invalidate(); pWnd->UpdateWindow(); pControlDC->SetViewportOrg(0,0); pControlDC->MoveTo(0,0); pControlDC->LineTo(0,335); pControlDC->MoveTo(0,0); pControlDC->LineTo(400,0); int i,j; for(i=0;iSetPixel(i,j,RGB(200,200,200)); for(i=0;iSetPixel(j,i,RGB(200,200,200)); int x1,y1,x0,y0; UpdateData(true);
x1=m_x1; x0=m_x0; y1=m_y1; y0=m_y0; switch (Algorithm) { case 0: { int a,b,d1,d2,d,x,y; float dy,dx,m; dx=float(x1-x0); dy=float(y1-y0); m=dy/dx; if(mSetPixel(x,y,RGB(0,255,0)); while(xSetPixel(x,y,RGB(0,255,0)); } } else {










a=x0-x1;b=y1-y0;d=2*a+b; d1=2*a;d2=2*(a+b); x=y0;y=x0; pControlDC->SetPixel(x,y,RGB(0,255,0)); while(xSetPixel(y,x,