一行空间在任何轴上旋转.docVIP

  • 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

文档评论(0)

1亿VIP精品文档

相关文档