
计算机图形学
Li_yy123
hi
展开
-
OPENGL—环境配置
VS环境配置 将下载的压缩包解开,将得到5个文件(glut.dll, glut32.dll, glut.lib, glut32.lib,glut.h)(1)把glut.h复制到x:\Program Files\Microsoft\Visual Studio 10.0\VC\include\gl文件夹中,如果没有gl这个文件夹则可以自己新建一个。(x是你安装VS的盘符原创 2017-04-13 19:43:11 · 490 阅读 · 0 评论 -
OPENGL—编码裁剪(Cohen-Sutherland)法裁剪图
//编码裁剪(Cohen-Sutherland)法裁剪图#include"stdafx.h"#include#include class wcPt2D {public: float x, y;};const int winLeftBitCode = 0x1;const int winRightBitCode = 0x2;const int winBottomBitCo原创 2017-06-01 18:36:44 · 3344 阅读 · 1 评论 -
Graphics—边标志算法
#include "stdafx.h"#include #include using namespace std;//边标志算法void edgeMarkFill(int n,int *points){ int flag=0;//标志位,判断在图形区域内(1),还是在外面(0) int c1=0,c2=0;//c1为边界色,c2为背景色 int maxX=0,minX=原创 2017-06-01 18:32:32 · 1962 阅读 · 0 评论 -
Graphics—边界填充算法
//边界填充算法#include "stdafx.h"#include #include #include using namespace std;//4-连通边界填充算法int BoundaryFill(int x,int y){ int c=0; c=getpixel(x,y); if(c!=WHITE) putpixel(x,y,WHITE); if(c==W原创 2017-06-01 18:23:08 · 1945 阅读 · 0 评论 -
Graphics—边缘填充算法
/*多边形的区域填充:边缘填充算法边缘填充算法的基本思想是,逐边向右求补。可以按任意顺序处理多边形的每条边,在处理每条边时,首先求出该边与扫描线的交点,然后将每一条扫描线上交点右方的所有像素取补,多边形的所有边处理完毕之后,填充即完成*/#include"stdafx.h"#include#include#include#include#include#include#原创 2017-06-01 18:19:23 · 3324 阅读 · 0 评论 -
OPENGL—改进Bresenham画直线
// 改进Bresenham画直线#include "stdafx.h"#include #include void init(void) { glClearColor(1.0,1.0,1.0,1.0); //设置背景颜色为白色 glMatrixMode(GL_PROJECTION); //对投影相关进行操作 gluOrt原创 2017-06-01 18:14:50 · 782 阅读 · 0 评论 -
OPENGL—中点Bresenham画直线
//中点Bresenham画直线#include "stdafx.h"#include #include void init(void) { glClearColor(1.0,1.0,1.0,1.0); //设置背景颜色为白色 glMatrixMode(GL_PROJECTION); //对投影相关进行操作 gluOrth原创 2017-06-01 18:12:52 · 1083 阅读 · 0 评论 -
OPENGL—DDA画直线
// DDA画直线#include "stdafx.h"#include #include void init(void) { glClearColor(1.0,1.0,1.0,1.0); //设置背景颜色为白色 glMatrixMode(GL_PROJECTION); //对投影相关进行操作 gluOrtho2D(0.0原创 2017-06-01 18:10:59 · 1459 阅读 · 0 评论 -
openGL—中点Bresenham椭圆算法
// bb.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include void init(void) { glClearColor(0.0,0.0,0.0,0.0); //设置背景颜色为黑色 glMatrixMode(GL_PROJECTION); //对投影相关进行操作 gluOrt原创 2017-04-30 20:19:50 · 1611 阅读 · 0 评论 -
openGL— 中点Bresenham画圆
// aa.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include void Init(void) { glClearColor(0.0,0.0,0.0,0.0); //设置背景颜色为黑色 glMatrixMode(GL_PROJECTION); //对投影相关进行操作 gluOr原创 2017-04-30 20:19:01 · 1966 阅读 · 0 评论 -
openGL—绘制简单二维图形
// aa.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include void Initial(void) { glClearColor(1.0f,1.0f,1.0f,1.0f); //设置窗口背景颜色为白色 glMatrixMode(GL_PROJECTION); //指定设置投影参数原创 2017-04-30 20:17:19 · 4703 阅读 · 0 评论 -
OPENGL—钻石图案
// 第一个OPENGL程序,绘制钻石图案#include "StdAfx.h"#include #include #include #include #define pi 3.14159265 int n=8; int R=200,CX=250,CY=250; int *point; void initGraph (void){ glClearColor原创 2017-04-13 20:33:43 · 1977 阅读 · 0 评论 -
OPENGL—参数裁剪(Liang-Barsky算法)
#include"stdafx.h" #include #include #include using namespace std; void drawpolygon(double cd[]) { glBegin(GL_LINE_LOOP); glLineWidth(10); for (int i = 0; i < 8; i原创 2017-06-08 16:42:48 · 3787 阅读 · 0 评论