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

资源简介

glaux,glut,freeglut,glew,gltools,glut32,csharpgl,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

#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  2019-05-22 18:37  OpenGL安装包\Demo\
     目录           0  2019-05-22 18:37  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  2019-05-22 18:37  OpenGL安装包\freeglut\
     文件      210806  2017-04-15 14:51  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp.zip
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\bin\
     文件      198656  2015-03-15 14:28  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\bin\freeglut.dll
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\bin\x64\
     文件      235008  2015-03-14 16:02  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\bin\x64\freeglut.dll
     文件        1466  2013-05-11 11:20  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\Copying.txt
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\include\
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\include\GL\
     文件         703  2015-03-14 15:34  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\include\GL\freeglut.h
     文件       10682  2015-03-14 15:34  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\include\GL\freeglut_ext.h
     文件       27470  2015-07-22 08:45  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\include\GL\freeglut_std.h
     文件         660  2015-03-14 15:34  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\include\GL\glut.h
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\lib\
     文件       39732  2015-03-14 15:19  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\lib\freeglut.lib
     目录           0  2019-05-22 18:37  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\lib\x64\
     文件       36518  2015-03-14 15:24  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\lib\x64\freeglut.lib
     文件        5065  2015-07-22 08:47  OpenGL安装包\freeglut\freeglut-MSVC-3.0.0-2.mp\freeglut\Readme.txt
     目录           0  2019-06-18 09:57  OpenGL安装包\glAux\
     文件     1386496  2011-11-13 16:06  OpenGL安装包\glAux\glaux.dll
     文件       12024  2011-11-13 16:06  OpenGL安装包\glAux\GLAUX.H
     文件     1189322  2011-11-13 17:02  OpenGL安装包\glAux\glaux.lib
............此处省略1200个文件信息

评论

共有 条评论