opengl源文件_plane_作业.docx

  1. 1、本文档共10页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
opengl源文件_plane_作业

#include stdio.h#include windows.h#includemath.h#include GL/gl.h#include GL/glu.h#include GL/glaux.h#define pi 3.1415926#include MilkModel.h // Header File For Milkshape File/*实现还需几个头文件,然后建立工程*/void init(void);void CALLBACK reshape(GLsizei w,GLsizei h);void CALLBACK On0KeyDown(void);void CALLBACK On1KeyDown(void);void CALLBACK OnSpaceDown(void);void CALLBACK OnLButtonDown(AUX_EVENTREC *);void CALLBACK OnLButtonMove(AUX_EVENTREC *);void CALLBACK display(void);void pickObjects(void);void processHits (GLint hits, GLuint buffer[]);void drawCoordinates(void);void load_oro(void);void load_photo(void);void draw_photo(void);GLint mx,my; //position of mouseGLint hits,pick;// for the picking GLint m_state=0,space=1; //mouse usage and the space keyGLfloat x_angle=12.0f, y_angle=8.0f,t_angle=0.0f;//angle of eyeGLdouble dist=30; //distance from the eyeGLuint i_pick=0;// for pickingGLdouble r=45000;GLuint texPhoto = 0;//photo textureint sizeX, sizeY; //photo size;extern void DrawBitmapString(LPCSTR str);extern void DrawOutlineString(LPCSTR str);extern SIZE GetStringSize(LPCSTR str);extern void ReadDEM(char *); //read DEMGLdouble nearclip; GLdouble farclip; GLdouble steps; const GLdouble stepa = 0.2; GLdouble rx,rz; float xOrg, yOrg; float angle; float dx, dy; int nx, ny; float *pHight = NULL;GLuint texture = 0;void init(void)//初始化{glClearColor(0.0f,0.0f,0.0f,0.0f);glClear(GL_COLOR_BUFFER_BIT);if (loadModelData(Aereo.ms3d) == 0) // Loads The Model And Checks For Errorsreturn;loadTextures();// Loads Model Texturesload_oro();load_photo();}void load_photo(void){AUX_RGBImageRec *pImage;//Make texturepImage = auxDIBImageLoad(photo.bmp);sizeX = pImage-sizeX;sizeY = pImage-sizeY;glGenTextures(1, texPhoto);glBindTexture(GL_TEXTURE_2D, texPhoto);gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage-sizeX, pImage-sizeY, GL_RGB, GL_UNSIGNED_BYTE, pImage-data);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);free(pImage-data)

文档评论(0)

xcs88858 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档