资源简介
该文件里面包括OpenGL蓝宝书第五版里面所需的所有库(均已经编译好)
代码片段和文件信息
// Block.cpp
// OpenGL SuperBible Chapter 1
// Demonstrates an assortment of basic 3D concepts
// Program by Richard S. Wright Jr.
#include // OpenGL toolkit
#include
#include ame.h>
#include
#include
#include
#include
#ifdef __APPLE__
#include
#else
#define FREEGLUT_STATIC
#include
#endif
/////////////////////////////////////////////////////////////////////////////////
// An assortment of needed classes
GLShaderManager shaderManager;
GLMatrixStack modelViewMatrix;
GLMatrixStack projectionMatrix;
GLframe cameraframe;
GLFrustum viewFrustum;
GLBatch cubeBatch;
GLBatch floorBatch;
GLBatch topBlock;
GLBatch frontBlock;
GLBatch leftBlock;
GLGeometryTransform transformPipeline;
M3DMatrix44f shadowMatrix;
// Keep track of effects step
int nStep = 0;
// Lighting data
GLfloat lightAmbient[] = { 0.2f 0.2f 0.2f 1.0f };
GLfloat lightDiffuse[] = { 0.7f 0.7f 0.7f 1.0f };
GLfloat lightSpecular[] = { 0.9f 0.9f 0.9f };
GLfloat vLightPos[] = { -8.0f 20.0f 100.0f 1.0f };
GLuint textures[4];
///////////////////////////////////////////////////////////////////////////////
// Make a cube out of a batch of triangles. Texture coordinates and normals
// are also provided.
void MakeCube(GLBatch& cubeBatch)
{
cubeBatch.Begin(GL_TRIANGLES 36 1);
/////////////////////////////////////////////
// Top of cube
cubeBatch.Normal3f(0.0f 1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 1.0f 1.0f);
cubeBatch.Vertex3f(1.0f 1.0f 1.0f);
cubeBatch.Normal3f(0.0f 1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 1.0f 0.0f);
cubeBatch.Vertex3f(1.0f 1.0f -1.0f);
cubeBatch.Normal3f(0.0f 1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 0.0f 0.0f);
cubeBatch.Vertex3f(-1.0f 1.0f -1.0f);
cubeBatch.Normal3f(0.0f 1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 1.0f 1.0f);
cubeBatch.Vertex3f(1.0f 1.0f 1.0f);
cubeBatch.Normal3f(0.0f 1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 0.0f 0.0f);
cubeBatch.Vertex3f(-1.0f 1.0f -1.0f);
cubeBatch.Normal3f(0.0f 1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 0.0f 1.0f);
cubeBatch.Vertex3f(-1.0f 1.0f 1.0f);
////////////////////////////////////////////
// Bottom of cube
cubeBatch.Normal3f(0.0f -1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 0.0f 0.0f);
cubeBatch.Vertex3f(-1.0f -1.0f -1.0f);
cubeBatch.Normal3f(0.0f -1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 1.0f 0.0f);
cubeBatch.Vertex3f(1.0f -1.0f -1.0f);
cubeBatch.Normal3f(0.0f -1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 1.0f 1.0f);
cubeBatch.Vertex3f(1.0f -1.0f 1.0f);
cubeBatch.Normal3f(0.0f -1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 0.0f 1.0f);
cubeBatch.Vertex3f(-1.0f -1.0f 1.0f);
cubeBatch.Normal3f(0.0f -1.0f 0.0f);
cubeBatch.MultiTexCoord2f(0 0.0f 0.0f);
cubeBatch.Vertex3f(-1.0f -1.0f -1.0f
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
----------- --------- ---------- ----- ----
12965963 1150
- 上一篇:雷达目标识别研讨会课件-西电
- 下一篇:google earth api
相关资源
- OPENGL 画地球 真实感超强-纹理贴图 光
- OPENGL中的GLUT源代码
- Qt OpenGL 多图片纹理例程
- opengl中天空盒的绘制
- OpenGL下立方体 正四面体绘制与贴图。
- 资源文件此资源是作者博客教程所用
- openGL完成雪花飞舞源码
- OpenGL ES 显示RGB数据
- opengl实现鱼眼矫正(球面等距模型)
- OpenGL 立体房子模拟
- OpenGL 电梯仿真模型
- opengl地形、雨雪、火箭模拟.rar
- OPENGL API及扩展大全
- opengl 编写的cs 游戏
- OPENGL 作品 花儿
- Nate Robin的OpenGL教程(OpenGL编程指南中
- openGL 光照机器人
- OpenGL44PipelineMap.pdf
- 教室漫游 OpenGL
- OpenGL库(包括glewfreeglut和gltools)
- openGl 飞机模拟
- opengl绘制三维模型可用鼠标控制旋转
- opengl三维场景
- 计算机图形学opengl+shader几个
- opengl简单地形绘制
- OPENGL三维场景搭建、漫游、交互_vs2
- 基于体渲染的OpenGL烟雾模拟程序
- openGL下雨现象模拟
- OpenGL三维图形程序设计(Windows版)
- OpenGL实现鼠标旋转缩放平移操作
评论
共有 条评论