资源简介
绘制一个汽车
代码片段和文件信息
#include
#include
#include
static GLfloat xRot = 0.0f;
static GLfloat yRot = 0.0f;
void Display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(xRot 1.0f 0.0f 0.0f); //绕x轴旋转
glRotatef(yRot 0.0f 1.0f 0.0f); //绕y轴旋转
//车下半部
glClearColor(0.07 0.7 0.9 0.3);
glBegin(GL_POLYGON);
glColor3f(0.1 0.1 0.8);
//glVertex3f(-40.0f 0.0f 15.0f);
glVertex3f(40.0f 0.0f 15.0f);
glColor3f(1 0.5 0.8);
glVertex3f(40.0f -15.0f 15.0f);
glVertex3f(-40.0f -15.0f 15.0f);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.3 0.2 0.5);
glVertex3f(40.0f 0.0f -15.0f);
glVertex3f(40.0f 0.0f 15.0f);
glVertex3f(40.0f -15.0f 15.0f);
glVertex3f(40.0f -15.0f -15.0f);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.3 0.1 0.3);
glVertex3f(-40.0f 0.0f -15.0f);
glVertex3f(-40.0f 0.0f 15.0f);
glVertex3f(-40.0f -15.0f 15.0f);
glVertex3f(-40.0f -15.0f -15.0f);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.1 0.1 0.8);
glVertex3f(-40.0f 0.0f -15.0f);
glVertex3f(40.0f 0.0f -15.0f);
glColor3f(1 0.5 0.8);
glVertex3f(40.0f -15.0f -15.0f);
glVertex3f(-40.0f -15.0f -15.0f);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0 0 1);
glVertex3f(-40.0f 0.0f 15.0f);
glVertex3f(-40.0f 0.0f -15.0f);
glVertex3f(40.0f 0.0f -15.0f);
glVertex3f(40.0f 0.0f 15.0f);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.8 0.5 0.2);
glVertex3f(-40.0f -15.0f 15.0f);
glVertex3f(-40.0f -15.0f -15.0f);
glVertex3f(40.0f -15.0f -15.0f);
glVertex3f(40.0f -15.0f 15.0f);
glEnd();
//车上半部
glBegin(GL_POLYGON);
glColor3f(0 0 1);
glVertex3f(-20.0f 0.0f 15.0f);
glVertex3f(-10.0f 10.0f 15.0f);
glVertex3f(20.0f 10.0f 15.0f);
glVertex3f(25.0f 0.0f 15.0f);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0 0 1);
glVertex3f(-20.0f 0.0f -15.0f);
glVertex3f(-10.0f 10.0f -15.0f);
glVertex3f(20.0f 10.0f -15.0f);
glVertex3f(25.0f 0.0f -15.0f);
glEnd();
glBegin(GL_POLYGON);
gl
- 上一篇:qt上位机采集51单片机温湿度数据
- 下一篇:c++curllib传输json使用
相关资源
- 自洽SU3手性夸克-孤子模型中单重子的
- opencv激光中心线的提取
- 手性摄动理论中双迷人重子的辐射衰
- 自协变重子手性扰动理论中自旋1/2双
- MFC 日历控件 万年历 Calendar自绘
- Effective Morden C++ 高清文字版
- 基于VC、MATLAB的汽车制动性能仿真
- OpenCV Computer Vision Application Programming
- 基于图割的图像分割OpenCV+MFC实现
- 识别魔方颜色
- TensorFlow 内核剖析
- opencv版俄罗斯方块源码
- Kinect手势控制鼠标
- VS2013 / MFC + OpenCV 2.4.9实现视频的播放
- opengl实现水流效果sph
- opengl源代码,全是精华!
- 粒子滤波器+目标跟踪的C++实现,VS2
- OpenGL迷宫山东大学图形学实验三
- 线性代数C++模板库 Eigen 3.1.1 的CHM文档
- C语言openssl库SM2-SM3国密常用函数
- opengl的立方体消隐算法
- the Art & Science of C电子版PDF+DOC 带目录
- 张平OpenCV算法精讲基于python和C++教材
- FastReport V6.4.13 VCL Enterprise(安装包源
- 汽车加油行驶问题 C++算法实现
- vc++ opengl代码爆炸
- 我见过最漂亮的CS仿真程序openGL和C+
- 求点介数C++实现 Betweenness Centrality
- MISRA C:2012 EN
- 虹膜识别开源代码OSIRIS4.1基于opencv
评论
共有 条评论