资源简介
上学的assignment,新手适用,基本的画画~
代码片段和文件信息
//
// Standard C++ headers used by this program
//
#include // console I/O
#include // file I/O
#include // string streams
//
// Headers needed by OpenGL. The glew header must come first.
//
#include
#include
#define VA_POSITION 0
#define VA_COLOR 1
#define BUFFER_OFFSET(i) ((void*)(i))
#define GETRAND ((float)rand()/(float)RAND_MAX)
unsigned frameCount = 0;
float g_vertexData[] = {
-0.4f -0.4f 0.0f 0.0f 0.0f
0.4f -0.4f 0.0f 0.0f 0.0f
0.0f 0.1f 0.0f 1.0f 0.0f
-0.3f 0.0f 0.0f 0.0f 0.0f
0.3f 0.0f 0.0f 0.0f 0.0f
0.0f 0.4f 0.0f 1.0f 0.0f
-0.2f 0.3f 0.0f 0.0f 0.0f
0.2f 0.3f 0.0f 0.0f 0.0f
0.0f 0.65f 0.0f 1.0f 0.0f
-0.05f -0.4f 0.5f 0.25f 0.0f
0.05f -0.4f 0.5f 0.25f 0.0f
-0.05f -0.7f 0.0f 0.0f 0.0f
0.05f -0.7f 0.0f 0.0f 0.0f
-1.0f -0.7f 1.0f 1.0f 1.0f
1.0f -0.7f 1.0f 1.0f 1.0f
-1.0f -1.0f 0.5f 0.25f 0.0f
1.0f -1.0f 0.5f 0.25f 0.0f
};
float l_vertexData[] = {
0.3f 0.55f 1.0f 0.65f 0.0f
0.5f 0.7f 1.0f 1.0f 0.0f
0.25f 0.7f 0.0f 1.0f 0.0f
0.45f 0.55f 1.0f 0.0f 1.0f
0.375f 0.775f 1.0f 0.0f 0.0f
};
unsigned short l_indexData[] = {
0 1
1 2
2 3
3 4
4 0
};
float p_vertexData[] = {
-0.4f -0.4f 1.0f 0.65f 0.0f
0.4f -0.4f 1.0f 1.0f 0.0f
0.0f -0.4f 1.0f 0.75f 0.8f
-0.3f 0.0f 0.0f 1.0f 1.0f
0.3f 0.0f 1.0f 0.0f 1.0f
0.0f 0.0f 1.0f 1.0f 0.0f
-0.2f 0.3f 1.0f 1.0f 1.0f
0.2f 0.3f 0.2f 0.8f 0.2f
0.0f 0.65f 1.0f 0.0f 0.0f
0.0f 0.3f 0.0f 1.0f 0.0f
};
//
// Function prototypes. These tell the compiler that these function exist somewhere in the code.
//
// the function that initializes everything
bool Initialize(int argc char* argv[]);
// helper functions that initialize specific components
bool InitWindow(int argc char* argv[]);
bool InitExtensions();
bool InitGeometry();
bool InitShaders();
bool InitScene();
// callback functions that freeglut will call once it enters the main loop
void Resize(int w int h);
void Render();
void Cleanup();
void TimerFunction1(int Value);
void KeyPressed(unsigned char key int x int y);
// functions for cleaning up specific components
void DeleteGeometry();
void DeleteShaders();
// function that reads a text file and returns it as a string
std::string ReadTextFile(std::string path);
// function that loads a shader from a
- 上一篇:DSP28335的PMSM的SVPWM电机代码
- 下一篇:Stm32 CAN通讯
相关资源
- OpenGL参考手册
- Qt Creator opengl实现四元数鼠标控制轨迹
- OpenGL文档,api大全,可直接查询函数
- opengl轮廓字体源代码
- MFC读三维模型obj文件
- 利用OpenGL写毛笔字算法
- MFC中OpenGL面和体的绘制以及动画效果
- 基于OPENGL的光线跟踪源代码368758
- VC 实现三维旋转(源码)
- 自编用openGL实现3D分形树,分形山
- OpenGL球形贴图自旋程序
- OpenGL导入贴图的Texture类
- 计算机图形学(openGL)代码
- 用OpenGL开发的机械臂运动仿真程序(
- OpenGL-3D坦克模拟
- 8051单片机教程第二十七课:单片机几
- 8051单片机教程第二十六课:矩阵式键
- OPENGL实现世界上最小的3D游戏
- VS2012OpenGL配置所需要的全部libdllh文件
- 电子电路设计新手指南
- 易语言天下2新手卡领取器源码
- 基于OpenGL的仿蝗虫机器人三维动态仿
- 图形学 - OpenGL实现3种三维茶壶显示源
- opengl程序-会跳舞的骷髅
- opengl实现三维网格光顺Laplacian算法
- 黑客入门新手特训.pdf
- opengl——爆炸
- OpenGL三维地形建模
- opengl游戏编程徐明亮版(含源码)
- 用OPENGL画的一个简单的直升飞机
评论
共有 条评论