• 大小: 5.8MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-09
  • 语言: 其他
  • 标签: Study  

资源简介

包含各种资源,freeglut,glew,gltools,glut,可以直接拿来用,按照百度搜索一下怎么用就ok

资源截图

代码片段和文件信息

// 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

#pragma comment(lib“gltools.lib“)

/////////////////////////////////////////////////////////////////////////////////
// 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);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-04-17 19:59  OpenGL安装包\
     目录           0  2017-04-17 19:59  OpenGL安装包\Demo\
     目录           0  2017-04-17 19:59  OpenGL安装包\Demo\Block\
     文件       18990  2017-04-18 22:04  OpenGL安装包\Demo\Block\Block.cpp
     文件      196652  2010-03-20 19:17  OpenGL安装包\Demo\Block\Block4.tga
     文件      196652  2010-03-20 19:17  OpenGL安装包\Demo\Block\Block5.tga
     文件      196652  2010-03-20 19:17  OpenGL安装包\Demo\Block\Block6.tga
     文件      196652  2010-03-20 19:17  OpenGL安装包\Demo\Block\floor.tga
     目录           0  2017-04-17 19:24  OpenGL安装包\freeglut\
     文件      210806  2017-04-15 14:51  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp.zip
     目录           0  2017-04-17 19:26  OpenGL安装包\glew\
     目录           0  2017-04-17 19:26  OpenGL安装包\glew\compiled\
     文件     2158207  2017-04-15 13:33  OpenGL安装包\glew\compiled\glew-2.0.0-win32.zip
     目录           0  2017-04-17 19:25  OpenGL安装包\glew\src\
     目录           0  2017-04-17 19:25  OpenGL安装包\glew\src\glew-2.0.0\
     文件     1043367  2017-04-16 09:43  OpenGL安装包\glew\src\glew-2.0.0.zip
     目录           0  2017-04-17 19:25  OpenGL安装包\glew\src\glew-2.0.0\auto\
     目录           0  2017-04-17 19:25  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\
     文件         522  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\filter_gles_ext.sh
     文件       22164  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\filter_gl_ext.sh
     文件        1271  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\filter_spec.py
     文件        5452  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make.pl
     文件         851  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_def_fun.pl
     文件         792  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_def_var.pl
     文件        1112  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_enable_index.pl
     文件        1697  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_header.pl
     文件        1453  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_html.pl
     文件         915  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_index.pl
     文件        1617  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_info.pl
     文件        1303  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_info_list.pl
     文件        1619  2016-07-24 08:43  OpenGL安装包\glew\src\glew-2.0.0\auto\bin\make_init.pl
............此处省略1119个文件信息

评论

共有 条评论