- 博客(13)
- 资源 (13)
- 收藏
- 关注
原创 顶点着色器
textfile.h的内容:char *textFileRead(char *fn);textfile.cpp的内容:#include<stdio.h>#include<stdlib.h>#include<string.h>char *textFileRead(char *fn){ FILE *fp; char *content = NULL; int coun...
2018-03-09 19:03:35
628
原创 片源着色器
textfile.h内容:char *textFileRead(char *fn);textfile.cpp内容:#include<stdio.h>#include<stdlib.h>#include<string.h>char *textFileRead(char *fn){ FILE *fp; char *content = NULL; int count ...
2018-03-09 18:47:08
645
原创 内置的uniform变量
gl_ModelViewMatrixgl_ProjectionMatrixgl_ModelViewProjectiongl_NormalMatrixgl_NormalScalegl_Pointgl_FrontMaterialgl_BackMaterialgl_LightModel
2018-03-07 13:49:03
460
原创 下载和安装GLUT
下载网址:https:://www.opengl.org/resources/libraries/glut点击The GLUT 3.7page with all info and all downloads->GLUT for Microsoft Windows 95& NT users->Glut for Windows->glut-3.7.6-bin.zip(117K...
2018-03-06 15:07:22
9087
转载 openGL绘制太阳系
#include "stdafx.h"#include<windows.h>#include "gl.h"#include "glut.h"#include<stdlib.h>#include<stdio.h>//行星GLfloat rot0 = 30.0;GLfloat rot1 = 0.0;GLfloat rot2 = 0.0;GLfloat rot3 =..
2018-02-11 10:46:46
5679
1
原创 openGL时钟绘制
#include "stdafx.h"#include<windows.h>#include"glut.h"#include"gl.h"#include<time.h>#include<math.h>int width = 500;int height = 500;int radius = 100;float sangle, mangle, hangle;cha..
2018-02-11 10:39:45
2468
1
转载 openGL绘制小汽车
#include <windows.h> #include"gl.h" #include"glut.h"#include <math.h> static GLfloat xRot = 0.0f;static GLfloat yRot = 0.0f;void Display(void){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BU...
2018-02-11 10:37:43
10387
2
原创 openGL绘制多光源球
#include "stdafx.h"#include<windows.h>#include "gl.h"#include "glut.h"void RenderScene(void){ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glPushMatrix(); glTranslatef(-3.0f, -3.0f, 3.0f);/...
2018-02-11 10:34:53
1002
原创 openGl深度测试,剔除背面测试
#include "stdafx.h"#include<Windows.h>#include"gl.h"#include"glut.h"//旋转参数static GLfloat xRot = 0.0f;static GLfloat yRot = 0.0f;//深度测试技术BOOL bDepth = FALSE;//剔除开关BOOL bCull = FALSE;//渲染场景void Se...
2018-02-11 10:29:50
631
原创 openGL键盘控制三角形旋转
#include "stdafx.h"#include<Windows.h>#include"gl.h"#include"glut.h"//确定多边形绕法bool bWinding = TRUE;//旋转参数static GLfloat xRot = 0.0f;static GLfloat yRot = 0.0f;void RenderScene(void){ glClear(GL_C...
2018-02-10 15:48:09
2606
原创 openGL绘制移动的矩形
#include "stdafx.h"#include"windows.h"#include"gl.h"#include"glut.h"//参数指定正方形位置和大小GLfloat x1 = 100.0f;GLfloat y1 = 150.0f;GLsizei rsize = 50;//正方形运动变换的步长GLfloat xstep = 1.0f;GLfloat ystep = 1.0f;//窗口大...
2018-02-10 14:54:25
1934
原创 openGL绘制矩形
#include "stdafx.h"#include"windows.h"#include"gl.h"#include"glut.h"//渲染场景void RenderScene(void){ //用当前清除色清除颜色缓冲区,设定窗口背景色 glClear(GL_COLOR_BUFFER_BIT); //设置当前绘图使用RGB颜色 glColor3f(1.0f, 0.0f, 0.0f); //使...
2018-02-10 14:35:34
1522
原创 openGL绘制点,线
#include "stdafx.h"#include<Windows.h>#include"gl.h"#include"glut.h"//渲染场景void RenderScene(void){ glClear(GL_COLOR_BUFFER_BIT);//用当前颜色填充窗口 glColor3f(1.0f, 0.0f, 0.0f);//设置当前的绘图RGB颜色值 GLfloat si...
2018-02-10 13:42:25
2382
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人