- 2
- 0
- 约15.05万字
- 约 11页
- 2017-07-07 发布于河南
- 举报
一行空间在任何轴上旋转
/*
* This Code Was Created By Jeff Molofee 2000
* A HUGE Thanks To Fredric Echols For Cleaning Up
* And Optimizing The Base Code, Making It More Flexible!
* If Youve Found This Code Useful, Please Let Me Know.
* Visit My Site At nehe.gamedev.net
*/
#include windows.h // Header File For Windows
#include gl\gl.h // Header File For The OpenGL32 Library
#include gl\glu.h // Header File For The GLu32 Library
#include gl\glaux.h // Header File For The Glaux Library
#include iostream.h
#include math.h
#define Pi 3.141592653
float tempory[4][4],Rab[4][4];
float Ta[4][4], Rx[4][4], Ry[4][4], Rz[4][4], Ry_1[4][4], Rx_1[4][4], Ta_1[4][4];
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
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc
GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window
{
if (height==0) // Prevent A Divide By Zero By
{
height=1; // Making Height Equal One
}
glViewport(0,0,width,height); // Reset The Current Viewport
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,10000.0f);
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity(); // Reset The Modelview Matrix
}
int InitGL(GLvoid) // All Setup For OpenGL Goes Here
{
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
glClearDepth(1.0f); // Dep
您可能关注的文档
- SMPP信令.ppt
- SMS基本知识及常见问题解决.ppt
- SolidWorks COSMOSWorks的介绍和说明.ppt
- SolidWorks的插件.doc
- soundwin网关.doc
- SOPC技术与NiosⅡ软核处理器.ppt
- SolidWorks的性能优化.ppt
- SCI检索技术.ppt
- SEM搜索营销培训王景涛.ppt
- SP2的安装方法进行2014年.doc
- 2025版腰椎间盘突出症中西医结合诊疗专家共识.pptx
- 2025版中国呼吸重症康复治疗技术专家共识解读PPT课件.pptx
- 2026南方财经全媒体集团招聘实习编辑1名考试备考题库及答案解析.docx
- 2025版早产儿出院后随访与健康管理专家共识.pptx
- 2025版中国经导管左心耳封堵术临床路径专家共识解读PPT课件.pptx
- 2026南昌东湖区医疗保障服务中心招聘工作人员笔试参考题库及答案解析.docx
- 幼儿情感教育方案_1.pptx
- 上海航天设备制造总厂有限公司2026届校园招聘考试备考题库及答案解析.docx
- 2025版中国系统性红斑狼疮诊疗指南解读PPT课件.pptx
- 2025版中国流感治疗与药物预防临床实践指南PPT课件.pptx
最近下载
- 深入开源处理器内部,RISC-V技术分析.doc VIP
- 现代住宅小区10KV0.4KV供配电系统设计论文--毕业论文设计.doc VIP
- RISC-V架构:开放源码处理器芯片的崛起.pptx VIP
- 3.2.1 水的利用与散失 课件-人教版(2024)生物七年级下册.pptx VIP
- 基于RISC-V架构处理器的通讯平台.pdf VIP
- RISC-V处理器芯片的电源网络设计.docx VIP
- 盘点一些用上先进制程工艺的RISC-V处理器.doc VIP
- 基于RISC-V参数化超标量处理器的优化设计.docx VIP
- 蜂鸟e200系列risc v开源处理器humming bird v1bob hu.pdf VIP
- 优捷通RISC处理器设计.pptx VIP
原创力文档

文档评论(0)