计算机图形学上机实习报告

计算机图形学 含代码 结果

计算机图形学试验报告()

试验名称:

专业: 09地理信息系统 班级:1 学号:080909姓名:日

一、 试验内容:画人跑步,制作一幅动态的图像。

二、试验目的:熟悉代码的编辑。

三、试验原理:要画图,就需运用光标定位,确定坐标的位置。由于图形显示器和显示模式的不同,x、y坐标的最大值也就不同。在这个编程代码中首先确定光标的位置,每移动一次正的向左边和下边,负的向右边和上边。

四、试验程序

#include "graphics.h"

#include "conio.h"

#include "stdio.h"

#include "stdlib.h"

#include "dos.h"

void main(void)

{

int gdriver=DETECT,gmode,errorcode;

int x,y,x1=12;

int buf1[3000],buf2[4000];

initgraph(&gdriver,&gmode,"");

errorcode=graphresult();

if(errorcode!=grOk)

{

printf("Graphics error:%s\n",grapherrormsg(errorcode));

printf("Press any to halt:");

getch();

return;

}

x=getmaxx();y=getmaxy();

line(0,y/2+72,x,y/2+72);

circle(x/2,y/2,10);

计算机图形学上机实习报告相关文档

最新文档

返回顶部