南昌大学计算机图形学实验报告

更新时间:2023-07-18 13:12:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

实 验 报 告

实验课程:计算机图形学 学生姓名:涂汉江 学号:专业班级:数媒101班

2012年 12 月 16号

目录

实验1 绘制直线和圆……………………………………………………………….1

实验2 种子填充算法……………………………………………………………….3

实验3 线条的剪裁………………………………………………………………….6

实验4 B样条曲线绘制……………………………………………………………..10

实验 5 deboor曲线的绘制…………………………………………………………..13

南昌大学实验报告

void C线与圆2View::midcircle(int r,int color,CDC *pDC) {

} else { }

d+=2*(x-y)+5; x++; y--;

int x=0; float d; d=1.25-r;

pDC->SetPixelV(x+100,y+100,RGB(255,0,while(x<y) {

if(d<0) {

d+=2*x+3; x++;

int y=r;

学生姓名:涂汉江学号:6100410181专业班级:数字媒体101班

实验类型:□验证□综合■设计□创新 实验日期:2012-12-16

实验1 绘制直线和圆

1.实验目的

掌握基本图形的绘制

0));

2.实验内容

1.、绘制一条直线 2、.绘制一个圆

3.实验环境

1、个人计算机

2、Windows7操作系统 3、VS2010

4.实验步骤

主要的代码:

1、线的实现代码:

这里采用的是数值微分法的方法

void C线与圆2View::dda(int x0,int y0,int x1,int y1,int color,CDC *pDC) { }

pDC->SetPixelV(x,int(y+0.5),RGB(255 }

y=y+k;

,0,0));

float dx,dy,k,y; dx=x1-x0; dy=y1-y0; k=dy/dx; y=y0;

for(int x=x0;x<=x1;x++) {

pDC->SetPixelV(x+100,y+100,RGB(255,0,pDC->SetPixelV(y+100,x+100,RGB(255,0,pDC->SetPixelV(-x+100,y+100,RGB(255,0pDC->SetPixelV(x+100,-y+100,RGB(255,0pDC->SetPixelV(-x+100,-y+100,RGB(255,pDC->SetPixelV(-y+100,x+100,RGB(255,0pDC->SetPixelV(y+100,-x+100,RGB(255,0pDC->SetPixelV(-y+100,-x+100,RGB(255,}

0)); 0)); ,0)); } ,0)); 0,0)); ,0)); ,0)); 0,0));

2、圆的实现代码

这里采用的是中点画圆算法

3、头文件包含的文件 #include "stdafx.h"

// SHARED_HANDLERS 可以在实现预览、

缩略图和搜索筛选器句柄的

// ATL 项目中进行定义,并允许与该项目共享文档代码。

#ifndef SHARED_HANDLERS #include "线与圆.h" #endif

#include "线与圆Doc.h" #include "线与圆View.h"

#ifdef _DEBUG

#define new DEBUG_NEW #endif

4、调用部分

void C线与圆View::OnDraw(CDC* pDC) { C);

C线与圆Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc)

return;

midcircle(50,RGB(255,0,0),pDC); dda(200,200,300,300,RGB(255,0,0),pD

}

这里画的是原点为(100,100)半径为50的圆和一条以(200,200)和(300,300)为端点的线段。

5、实验结果如下截图:

5.实验思考和问题解决

本来只能做出1/4的圆的,通过改变中心坐标和坐标正负号,重复循环4次,最后得到一个整圆。前面有做直线的经验,所以总体来说还是比较顺利的。 上个学期学习了数值分析课程,也用过类似的描点函数,同样是设计函数,实现循环描点。

南昌大学实验报告

// NOTE - the ClassWizard will add // DO NOT EDIT what you see in

and remove mapping macros here. these blocks of generated code!

//}}AFX_MSG_MAP

// Standard printing commands ON_COMMAND(ID_FILE_PRINT, ON_COMMAND(ID_FILE_PRINT_DIRECT, ON_COMMAND(ID_FILE_PRINT_PREVIEW,

学生姓名:涂汉江学号:6100410181专业班级:数字媒体101班

实验类型:□验证□综合■设计□创新 实验日期:2012-12-16

实验2 种子填充算法 1.实验目的

掌握图形的填充算法

CView::OnFilePrint) CView::OnFilePrint) CView::OnFilePrintPreview) END_MESSAGE_MAP()

///////////////////////////////////////////////////////////////////////////// // CSeedfillView construction/destruction

CSeedfillView::CSeedfillView() { }

CSeedfillView::~CSeedfillView() { } BOOL

CSeedfillView::PreCreateWindow(CREATESTRUCT& cs) { }

///////////////////////////////////////////////////////////////////////////// // CSeedfillView drawing

void CSeedfillView::OnDraw(CDC* pDC)

2.实验内容

1.绘制一个矩形

2.用种子填充算法为其上色

3.实验环境

1.个人计算机

2.Windows7操作系统 3.VS2010

4.实验步骤

主要代码部分:

// seedfillView.cpp : implementation of the CSeedfillView class //

#include "stdafx.h" #include "seedfill.h"

#include "seedfillDoc.h" #include "seedfillView.h"

#ifdef _DEBUG

#define new DEBUG_NEW #undef THIS_FILE

static char THIS_FILE[] = __FILE__; #endif

///////////////////////////////////////////////////////////////////////////// // CSeedfillView

IMPLEMENT_DYNCREATE(CSeedfillView, CView)

BEGIN_MESSAGE_MAP(CSeedfillView, CView)

//{{AFX_MSG_MAP(CSeedfillView)

// TODO: add construction code here

// TODO: Modify the Window class or // the CREATESTRUCT cs

return CView::PreCreateWindow(cs);

styles here by modifying

CSeedfillDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc);

// TODO: add draw code for native data

}

}

here

DrawRectangle(pDC); }

void CSeedfillView::seed(int x,int y,int fillcolor,int oldcolor,CDC* pDC) { }

void CSeedfillView::DrawRectangle(CDC* pDC) {

///////////////////////////////////////////////////////////////////////////// // CSeedfillView printing BOOL

CSeedfillView::OnPreparePrinting(CPrintInfo* pInfo) { }

void CSeedfillView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) {

pDC->SetPixelV(x,y,fillcolor);

} void {

// TODO: add cleanup after printing }

///////////////////////////////////////////////////////////////////////////// // CSeedfillView diagnostics

#ifdef _DEBUG

void CSeedfillView::AssertValid() const { }

void CSeedfillView::Dump(CDumpContext& dc) const { }

CView::Dump(dc); CView::AssertValid();

CSeedfillView::OnEndPrinting(CDC* // TODO: add extra initialization before printing

// default preparation

return DoPreparePrinting(pInfo);

seed(210,210,(255,0,0),(225,255,225

),pDC);

int ccolor;

ccolor = pDC->GetPixel(x,y); if(ccolor!=oldcolor&&ccolor!=fillco{

lor)

seed(x+1,y,fillcolor,oldcolor,pDC); seed(x-1,y,fillcolor,oldcolor,pDC); seed(x,y+1,fillcolor,oldcolor,pDC); seed(x,y-1,fillcolor,oldcolor,pDC); }

/*pDC*/, CPrintInfo* /*pInfo*/)

for(int i=200;i<=300;i++) {

pDC->SetPixelV(200,i,RGB(0,0,0)); pDC->SetPixelV(300,i,RGB(0,0,0)); pDC->SetPixelV(i,200,RGB(0,0,0));

CSeedfillDoc*

CSeedfillView::GetDocument() non-debug version is inline { }

#endif //_DEBUG

///////////////////////////////////////////////////////////////////////////// // CSeedfillView message handlers

ASSERT(m_pDocument->IsKindOf(RUNTIMreturn (CSeedfillDoc*)m_pDocument; E_CLASS(CSeedfillDoc)));

//

运行结果如下:

5.实验思考和问题解决

参考书上的伪代码并且与同学室友相互讨论实践才得到最后的结果,结果也差强人意,图显示的效果不好,很小。

南昌大学实验报告

//

#include "stdafx.h" #include "LineCut.h"

#include "LineCutDoc.h" #include "LineCutView.h"

#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE

static char THIS_FILE[] = __FILE__; #endif

///////////////////////////////////////////////////////////////////////////// // CLineCutView

IMPLEMENT_DYNCREATE(CLineCutView, CView)

BEGIN_MESSAGE_MAP(CLineCutView, CView) }

CLineCutView::~CLineCutView() { } BOOL

CLineCutView::PreCreateWindow(CREATESTRUCT& cs) { }

///////////////////////////////////////////////////////////////////////////// // CLineCutView drawing

void CLineCutView::OnDraw(CDC* pDC)

学生姓名:涂汉江学号:6100410181专业班级:数字媒体101班

实验类型:□验证□综合■设计□创新 实验日期:2012-12-16

实验3线条的剪裁

1.实验目的

掌握对线条的剪裁算法

2.实验内容

1.绘制一条直线 2.绘制一个矩形 3.计算矩形内的线段 4.绘制矩形内的线段

3.实验环境

1.个人计算机

2.Windows7操作系统 3.VS2010

4.实验步骤

// LineCutView.cpp : implementation of the CLineCutView class

// NOTE - the ClassWizard will add and remove mapping macros here.

// DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP

// Standard printing commands

ON_COMMAND(ID_FILE_PRINT, ON_COMMAND(ID_FILE_PRINT_DIRECT, ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrint) CView::OnFilePrint) CView::OnFilePrintPreview) END_MESSAGE_MAP()

///////////////////////////////////////////////////////////////////////////// // CLineCutView construction/destruction

CLineCutView::CLineCutView() {

// TODO: add construction code here

//{{AFX_MSG_MAP(CLineCutView)

// TODO: Modify the Window class or // the CREATESTRUCT cs

return CView::PreCreateWindow(cs);

styles here by modifying

DrawRectangle(pDC);

DrawLine(100,200,400,300,RGB(255,0,0), pDC);

C_S_Line_Clip(100,200,400,300,pDC); } void pDC) { }

void CLineCutView::DrawLine(int x0,int y0,int x1,int y1,int color,CDC* pDC) { }

CLineCutDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc);

// TODO: add draw code for native data

void CLineCutView::encode(float x,float y,int &code) {

CLineCutView::DrawRectangle(CDC*

for(int i=200;i<=300;i++) {

pDC->SetPixelV(200,i,RGB(0,0,0)); pDC->SetPixelV(300,i,RGB(0,0,0)); pDC->SetPixelV(i,200,RGB(0,0,0)); pDC->SetPixelV(i,300,RGB(0,0,0)); }

} void {

int x;

float dx,dy,k,y; dx=x1-x0; dy=y1-y0; k=dy/dx; y=y0;

for(x=x0;x<=x1;x++) {

pDC->SetPixelV(x,int (y+0.5),color); }

y=y+k;

int x,y;

int code1,code2,code; encode(x1,y1,code1); encode(x2,y2,code2); while(code1!=0 || code2!=0) {

y=y1+(y2-y1)*(XL-x1)/(x2-x1);

}

else if((RIGHT&code)!=0) { }

else if((BOTTOM&code)!=0) {

x=XR;

y=y1+(y2-y1)*(XR-x1)/(x2-x1); if((code1&code2)!=0)

return; code=code1; if(code1==0) {

x=XL; code=code2; if((LEFT&code)!=0)

CLineCutView::C_S_Line_Clip(float

x1,float y1,float x2,float y2,CDC* pDC)

int c; c=0; if(x<XL)

c=c|LEFT; c=c|RIGHT; c=c|BOTTOM; c=c|TOP; else if(x>XR) if(y<YB) else if(y>YT) code=c;

here

}

{ } void { }

///////////////////////////////////////////////////////////////////////////// // CLineCutView diagnostics

#ifdef _DEBUG

void CLineCutView::AssertValid() const { }

void CLineCutView::Dump(CDumpContext& dc) const { }

CLineCutDoc* CLineCutView::GetDocument() // non-debug version is inline { }

#endif //_DEBUG

///////////////////////////////////////////////////////////////////////////// // CLineCutView message handlers

ASSERT(m_pDocument->IsKindOf(RUNTIME_return (CLineCutDoc*)m_pDocument; CLASS(CLineCutDoc)));

CView::Dump(dc); CView::AssertValid();

// TODO: add cleanup after printing

CLineCutView::OnEndPrinting(CDC* // TODO: add extra initialization

x=x1+(x2-x1)*(YB-y1)/(y2-y1);

x=x1+(x2-x1)*(YT-y1)/(y2-y1); }

//DISplayLine(x1,y1,x2,y2); DrawLine(x1,y1,x2,y2,RGB(0,0,0), DrawLine(x1,y1,x2,y2,RGB(0,0,255), return;

}

if(code==code1) { } else { }

x2=x; y2=y;

encode(x,y,code2); x1=x; y1=y;

encode(x,y,code1); }

else if((TOP&code)!=0) {

y=YT;

before printing

/*pDC*/, CPrintInfo* /*pInfo*/)

pDC); pDC);

///////////////////////////////////////////////////////////////////////////// // CLineCutView printing BOOL

CLineCutView::OnPreparePrinting(CPrintInfo* pInfo) { }

void CLineCutView::OnBeginPrinting(CDC*

// default preparation

return DoPreparePrinting(pInfo);

运行结果如下:

5.实验思考和问题解决

这次实验的主要目的是完成对既有线条的剪裁。首先用直线的绘制方法绘制出矩形的边框,然后绘制出直线,再调用剪裁算法完成对直线的剪裁和剪裁后线段的输出。

此次算法仅实现了对直线的剪裁,而无通用性。因此在以后的学习生活中应该思考如何编写具有通用性的剪裁算法。

南昌大学实验报告

these blocks of generated code!

//}}AFX_MSG_MAP

// Standard printing commands ON_COMMAND(ID_FILE_PRINT, ON_COMMAND(ID_FILE_PRINT_DIRECT, ON_COMMAND(ID_FILE_PRINT_PREVIEW,

学生姓名:涂汉江学号:6100410181专业班级:数字媒体101班

实验类型:□验证□综合■设计□创新 实验日期:2012-12-16

CView::OnFilePrint) CView::OnFilePrint) CView::OnFilePrintPreview) END_MESSAGE_MAP()

///////////////////////////////////////////////////////////////////////////// // CQuxianView construction/destruction

CQuxianView::CQuxianView() { }

CQuxianView::~CQuxianView() { } BOOL

CQuxianView::PreCreateWindow(CREATESTRUCT& cs) { }

///////////////////////////////////////////////////////////////////////////// // CQuxianView drawing

void CQuxianView::OnDraw(CDC* pDC) {

实验4 B样条曲线绘制 1.实验目的

掌握用B样条法进行曲线的绘制

2.实验内容

掌握用B样条法进行曲线的绘制

3.实验环境

1.个人计算机

2.Windows7操作系统 3.VS2010

4.实验步骤

// QuxianView.cpp : implementation of the CQuxianView class //

#include "stdafx.h" #include "Quxian.h"

#include "QuxianDoc.h" #include "QuxianView.h"

#ifdef _DEBUG

#define new DEBUG_NEW #undef THIS_FILE

static char THIS_FILE[] = __FILE__; #endif

///////////////////////////////////////////////////////////////////////////// // CQuxianView

IMPLEMENT_DYNCREATE(CQuxianView, CView)

BEGIN_MESSAGE_MAP(CQuxianView, CView)

//{{AFX_MSG_MAP(CQuxianView)

// NOTE - the ClassWizard will add // DO NOT EDIT what you see in

// TODO: add construction code here

// TODO: Modify the Window class or // the CREATESTRUCT cs

return CView::PreCreateWindow(cs);

styles here by modifying

and remove mapping macros here. CQuxianDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc);

}

// TODO: add draw code for native data DrawQ(pDC);

void { }

///////////////////////////////////////////////////////////////////////////// // CQuxianView diagnostics

#ifdef _DEBUG

void CQuxianView::AssertValid() const { }

CView::AssertValid();

// TODO: add cleanup after printing

CQuxianView::OnEndPrinting(CDC*

/*pDC*/, CPrintInfo* /*pInfo*/)

here

void CQuxianView::DrawQ(CDC* pDC) { } float {

float pp;

pp=point0*(1-t)*(1-t)*(1-t)+point1*

CQuxianView::p(int

point0,int

point1,int point2,int point3,float t)

float x,y;

for(float i=0.0;i<=1.0;i=i+0.0001) {

x=p(100,200,300,400,i); y=p(100,50,130,150,i);

pDC->SetPixelV(x,y,RGB(255,0,0)); }

void CQuxianView::Dump(CDumpContext& dc) const { }

CQuxianDoc* CQuxianView::GetDocument() // non-debug version is inline { }

#endif //_DEBUG

///////////////////////////////////////////////////////////////////////////// // CQuxianView message handlers

ASSERT(m_pDocument->IsKindOf(RUNTIME_return (CQuxianDoc*)m_pDocument; CLASS(CQuxianDoc)));

CView::Dump(dc);

3*t*(1-t)*(1-t)+point2*3*t*t*(1-t)+point3*t*t*t; }

///////////////////////////////////////////////////////////////////////////// // CQuxianView printing BOOL

CQuxianView::OnPreparePrinting(CPrintInfo* pInfo) { }

void CQuxianView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { }

return pp;

// default preparation

return DoPreparePrinting(pInfo);

运行结果如下:

// TODO: add extra initialization

before printing

5.实验思考和问题解决

此次试验使用B样条法绘制曲线。 上学期在数值分析实验课中学习过绘制字母及数字的方法,因此做此次作业变得得心应手。

首先设置四个控制点的坐标,设置变量T,多次循环逐一输出计算出的点的位置信息,就完成率了曲线的简单绘制。

南昌大学实验报告

CView::OnFilePrint)

ON_COMMAND(ID_FILE_PRINT_DIRECT, ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrint) CView::OnFilePrintPreview) END_MESSAGE_MAP()

///////////////////////////////////////////////////////////////////////////// // CDeboorView construction/destruction

CDeboorView::CDeboorView() { }

CDeboorView::~CDeboorView() { } BOOL

CDeboorView::PreCreateWindow(CREATESTRUCT& cs) { }

///////////////////////////////////////////////////////////////////////////// // CDeboorView drawing

void CDeboorView::OnDraw(CDC* pDC) {

CDeboorDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc);

// TODO: add draw code for native data return CView::PreCreateWindow(cs); // TODO: Modify the Window class or // the CREATESTRUCT cs styles here by modifying

// TODO: add construction code here

学生姓名:涂汉江学号:6100410181专业班级:数字媒体101班

实验类型:□验证□综合■设计□创新 实验日期:2012-12-16

实验5 deboor曲线的绘制 1.实验目的

掌握绘制deboor曲线

2.实验内容

绘制贝塞尔曲线

3.实验环境

1.个人计算机

2.Windows7操作系统 3.VS2010

4.实验步骤

// deboorView.cpp : implementation of the CDeboorView class //

#include "stdafx.h" #include "deboor.h" #include "deboorDoc.h" #include "deboorView.h" #ifdef _DEBUG

#define new DEBUG_NEW #undef THIS_FILE

static char THIS_FILE[] = __FILE__; #endif

///////////////////////////////////////////////////////////////////////////// // CDeboorView

IMPLEMENT_DYNCREATE(CDeboorView, CView)

BEGIN_MESSAGE_MAP(CDeboorView, CView)

//{{AFX_MSG_MAP(CDeboorView)

// NOTE - the ClassWizard will add // DO NOT EDIT what you see in

and remove mapping macros here. these blocks of generated code!

//}}AFX_MSG_MAP

// Standard printing commands ON_COMMAND(ID_FILE_PRINT,

here

//五个控制顶点四条边 /*

for(int i=0;i<=200;i++) {

pDC->SetPixelV(i+100,100,RGB(0,255,0)

); }

for(i=0;i<=100;i++) { }

deboordraw5(100,100,300,100,300,200,100,200,100,100,RGB(255,0,0),pDC) ; */

//四个控制顶点,三条边

deboordraw(100,200,200,100,300,150,400,400,RGB(255,0,0),pDC) ;

DrawLine(100,200,200,100,RGB(0,255,0),pDC);

DrawLine(200,100,300,150,RGB(0,255,0),pDC);

DrawLine(300,150,400,400,RGB(0,255,0),pDC); }

void CDeboorView::DrawLine(int x0,int y0,int x1,int y1,int color,CDC* pDC) { }

//五个控制点,四条边 void

CDeboorView::deboordraw5(float

x0,float y0,float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4,float color,CDC* pDC)

{

float x,y; float X[5]; float Y[5]; X[0]=x0; X[1]=x1; X[2]=x2; X[3]=x3; X[4]=x4; Y[0]=y0; Y[1]=y1; Y[2]=y2; Y[3]=y3; Y[4]=y4;

pDC->SetPixelV(i+100,200,RGB(0,255,

0));

pDC->SetPixelV(100,100+i,RGB(0,255,pDC->SetPixelV(300,100+i,RGB(0,255,

0)); 0));

pDC->SetPixelV(100,100,color); for(float t=0;t<=1;t=t+0.001) }

float CDeboorView::deboor5(float t,int r,int i,float p[5]) {

int T[8];

T[0]=T[1]=T[2]=T[3]=0; T[4]=T[5]=T[6]=T[7]=1; //static r=4; //static i=3; float a; if(r==0) { } else {

a=(t-T[i])/(T[i+4-r]-T[i])*deboor5(t,

//p=pi; return p[i];

{ }

x=deboor5(t,3,4,X); y=deboor5(t,3,4,Y);

pDC->SetPixelV(x,y,color); pDC->SetPixelV(x,y,color);

int x;

float dx,dy,k,y; dx=x1-x0; dy=y1-y0; k=dy/dx; y=y0;

for(x=x0;x<=x1;x++) {

pDC->SetPixelV(x,int (y+0.5),color); }

y=y+k;

r-1,i,p)+(T[i+4-r]-t)/(T[i+4-r]-T[i])*deboor5(t,r-1,i-1,p);

}

return a;

}

//四个控制顶点,三条边

float CDeboorView::deboor(float t,int r,int i,float p[4]) {

int T[8];

T[0]=T[1]=T[2]=T[3]=0; T[4]=T[5]=T[6]=T[7]=1; //static r=4; //static i=3; float a; if(r==0) { } else {

a=(t-T[i])/(T[i+4-r]-T[i])*deboor(t

//p=pi; return p[i];

pDC->SetPixelV(x,y,color); }

///////////////////////////////////////////////////////////////////////////// // CDeboorView printing BOOL

CDeboorView::OnPreparePrinting(CPrintInfo* pInfo) { } void { } void {

CDeboorView::deboordraw(float

}

/////////////////////////////////////////////////////////////////////////////

float x,y; float X[4]; float Y[4]; X[0]=x0; X[1]=x1; X[2]=x2; X[3]=x3; Y[0]=y0; Y[1]=y1; Y[2]=y2; Y[3]=y3; {

x=deboor(t,3,3,X); y=deboor(t,3,3,Y);

}

// default preparation

return DoPreparePrinting(pInfo);

CDeboorView::OnBeginPrinting(CDC*

/*pDC*/, CPrintInfo* /*pInfo*/)

// TODO: add extra initialization

before printing

,r-1,i,p)+(T[i+4-r]-t)/(T[i+4-r]-T[i])*deboor(t,r-1,i-1,p); } void

x0,float y0,float x1,float y1,float x2,float y2,float x3,float y3,float color,CDC* pDC) {

}

return a;

CDeboorView::OnEndPrinting(CDC*

/*pDC*/, CPrintInfo* /*pInfo*/)

// TODO: add cleanup after printing

// CDeboorView diagnostics

#ifdef _DEBUG

void CDeboorView::AssertValid() const { }

void CDeboorView::Dump(CDumpContext& dc) const { }

CDeboorDoc* CDeboorView::GetDocument() //

CView::Dump(dc); CView::AssertValid();

for(float t=0;t<=1;t=t+0.001)

non-debug version is inline { }

#endif //_DEBUG

///////////////////////////////////////////////////////////////////////////// // CDeboorView message handlers

ASSERT(m_pDocument->IsKindOf(RUNTIMreturn (CDeboorDoc*)m_pDocument; E_CLASS(CDeboorDoc)));

运行结果如下:

5.实验思考和问题解决

图形化的工具如ps学过一点,里面的钢笔工具添加锚点绘制封闭图形就是运用了贝塞尔方法绘制曲线的工具,里面曲线绘制简单直观,可见贝塞尔方法绘图的实用性与简便性。

本文来源:https://www.bwwdw.com/article/x7r1.html

Top