资源简介
在一个漫天飘雪的冬天,一个孤零零的雪人,伴着天空之城的背景音,让人陷入了无限沉思!!

代码片段和文件信息
#include // Header File For Windows
#include // PlaySound()
#include
#include
#include
#include “gl.h“ // Header File For The OpenGL32 Library
#include “glu.h“
#include “OGL.h“ // Header File For The GLu32 Library
#include “glaux.h“ // Header File For The Glaux Library
HDC hDC=NULL; // Private GDI Device Context
HGLRC hRC=NULL; // Permanent Rendering Context
HWND hWnd=NULL; // Holds Our Window Handle
HINSTANCE hInstance; // Holds The Instance Of The Application
bool keys[256]; // Array Used For The Keyboard Routine
bool active=TRUE; // Window Active Flag Set To TRUE By Default
bool fullscreen=TRUE; // Fullscreen Flag Set To Fullscreen Mode By Default
GLfloat yrot; // Y 旋转
GLfloat LightAmbient[]= { 0.5f 0.5f 0.5f 1.0f }; //环境光参数 ( 新增 )
GLfloat LightDiffuse[]= { 1.0f 1.0f 1.0f 1.0f }; // 漫射光参数 ( 新增 )
GLfloat LightPosition[]= { 0.0f 0.0f 2.0f 1.0f }; // 光源位置 ( 新增 )
#define TEXTURECOUNT 4
#define SNOWCOUNT 2000
LPTSTR bmpfile[TEXTURECOUNT]={_T(“Data/2.bmp“)_T(“Data/3.bmp“)_T(“Data/4.bmp“)_T(“Data/5.bmp“)};
GLuint texture[TEXTURECOUNT];
struct TSnow
{
float xyz;
float xrotyrotzrot;
float Dspeed;
float Rspeed;
int TextureIndex;
};
TSnow Snow[SNOWCOUNT];
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM); // Declaration For WndProc
AUX_RGBImageRec *LoadBMP(LPTSTR Filename) // Loads A Bitmap Image
{
FILE *File=NULL; // File Handle
if (!Filename) // Make Sure A Filename Was Given
{
return NULL; // If Not Return NULL
}
File=_tfopen(Filename_T(“r“)); // Check To See If The File Exists
if (File) // Does The File Exist?
{
fclose(File); // Close The Handle
return auxDIBImageLoad(Filename); // Load The Bitmap And Return A Pointer
}
return NULL; // If Load Failed Return NULL
}
int LoadGLTextures() // Load Bitmaps And Convert To Textures
{
int Status;
AUX_RGBImageRec *TextureImage[1]; // Create Storage Space For The Texture
glGenTextures(TEXTURECOUNT &texture[0]); // Create The Texture
for(int i=0;i {
Status=FALSE; // Status Indicator
memset(TextureImage0sizeof(void *)*1); // Set The Pointer To NULL
// Load The Bitmap Check For Errors If Bitmap‘s Not Found Quit
if (TextureImage[0]=LoadBMP(bmpfile[i]))
{
Status=TRUE; // Set The Status To TRUE
// 创建线性滤波纹理
glBindTexture(GL_TEXTURE_2D texture[i]);
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MAG_FILTERGL_LINEAR);
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MIN_FILTERGL_LINEAR);
glTexImage2D(GL_TEXTURE_2D 0 3 TextureImage[0]->sizeX TextureImage[0]->sizeY 0 GL_RGB GL_UNSIGNED_BYTE TextureImage[0]->data);
}
if (TextureImage[0]) // If Texture Exists
{
if (TextureImage[0]->data) // If Texture Image Exists
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 69083 2011-06-16 23:13 opengl课程设计张淼\GL.H
文件 12065 2011-06-16 23:13 opengl课程设计张淼\GLAUX.H
文件 1312394 2011-06-16 23:14 opengl课程设计张淼\GLAUX.LIB
文件 234006 2011-06-16 23:13 opengl课程设计张淼\glext.h
文件 18282 2011-06-16 23:13 opengl课程设计张淼\GLU.H
文件 130048 2009-07-14 09:15 opengl课程设计张淼\glu32.dll
文件 12648 2011-06-16 23:14 opengl课程设计张淼\GLU32.LIB
文件 27670 2011-06-16 23:13 opengl课程设计张淼\glut.h
文件 237568 2001-11-08 02:27 opengl课程设计张淼\glut32.dll
文件 71040 2011-06-10 12:39 opengl课程设计张淼\glut32.lib
文件 641 2011-06-16 23:40 opengl课程设计张淼\OGL.h
文件 4052 2011-06-16 23:17 opengl课程设计张淼\OpenGl.vcxproj
文件 1228 2011-06-16 23:17 opengl课程设计张淼\OpenGl.vcxproj.filters
文件 143 2011-06-16 23:08 opengl课程设计张淼\OpenGl.vcxproj.user
文件 77112 2011-06-16 23:14 opengl课程设计张淼\OPENGL32.LIB
文件 4187 2011-06-17 00:01 opengl课程设计张淼\Snow.dsp
文件 514 2011-06-16 23:49 opengl课程设计张淼\Snow.dsw
文件 312320 2011-07-01 17:13 opengl课程设计张淼\Snow.ncb
文件 736 2011-07-01 17:13 opengl课程设计张淼\Snow.plg
文件 543 2011-06-16 22:24 opengl课程设计张淼\OpenGLWork.dsw
文件 33792 2011-06-17 19:23 opengl课程设计张淼\OpenGLWork.ncb
文件 37888 2011-06-17 19:23 opengl课程设计张淼\OpenGLWork.opt
文件 25417 2011-06-24 15:08 opengl课程设计张淼\myGL.cpp
文件 12342 1999-12-21 22:25 opengl课程设计张淼\Data\2.bmp
文件 12342 1999-12-21 22:26 opengl课程设计张淼\Data\3.bmp
文件 12342 1999-12-21 22:26 opengl课程设计张淼\Data\4.bmp
文件 196662 1999-12-21 20:20 opengl课程设计张淼\Data\5.bmp
文件 115119 1997-06-03 05:03 opengl课程设计张淼\Data\OPEN4.WAV
文件 1922732 2011-06-17 20:07 opengl课程设计张淼\Data\music.wav
文件 241703 2011-07-01 17:13 opengl课程设计张淼\Debug\Snow.exe
............此处省略13个文件信息
- 上一篇:三维点云数据的预处理研究
- 下一篇:手机红外遥控器 布局 数据库访问
相关资源
- OpenGL参考手册
- Qt Creator opengl实现四元数鼠标控制轨迹
- OpenGL文档,api大全,可直接查询函数
- opengl轮廓字体源代码
- MFC读三维模型obj文件
- 利用OpenGL写毛笔字算法
- MFC中OpenGL面和体的绘制以及动画效果
- 基于OPENGL的光线跟踪源代码368758
- VC 实现三维旋转(源码)
- 自编用openGL实现3D分形树,分形山
- OpenGL球形贴图自旋程序
- OpenGL导入贴图的Texture类
- 计算机图形学(openGL)代码
- 用OpenGL开发的机械臂运动仿真程序(
- OpenGL-3D坦克模拟
- OPENGL实现世界上最小的3D游戏
- VS2012OpenGL配置所需要的全部libdllh文件
- 基于OpenGL的仿蝗虫机器人三维动态仿
- 图形学 - OpenGL实现3种三维茶壶显示源
- opengl程序-会跳舞的骷髅
- opengl实现三维网格光顺Laplacian算法
- opengl——爆炸
- OpenGL三维地形建模
- opengl游戏编程徐明亮版(含源码)
- 用OPENGL画的一个简单的直升飞机
- opengl完美天空盒
- 3D绘图程序设计:使用Direct3D 10/9和Ope
- OpenGL绘制可运动自行车源程序.zip
- OpenGL实现飘动效果
- opengl室内场景的绘制,包括碰撞检测
评论
共有 条评论