Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "trexmovementanimation.h"
- void DisplayApplication()
- {//Функция, которая рендерит наше приложение.
- //SetLightSources();
- glutSetCursor(GLUT_CURSOR_INFO);
- Rexy.RenderTRex(); //Рендерим его
- glFlush();
- glutSwapBuffers();
- }
- void CameraView()
- {//Функция настройки вида в 3д пространстве.
- glClearColor(0.4, 0.9, 0.95, 0);
- glRotatef(60.0, 0, 1, 0);
- glScalef(1.2, 1.2, 1.2);
- }
- void SetLightSources()
- {//Функция, которая дает освещение сцены.
- glShadeModel( GL_SMOOTH );
- glClearDepth( 1.0f );
- glEnable( GL_DEPTH_TEST );
- glDepthFunc( GL_LEQUAL );
- GLfloat amb_light[] = { 0.1, 0.1, 0.1, 1.0 };
- GLfloat diffuse[] = { 0.6, 0.6, 0.6, 1 };
- GLfloat specular[] = { 0.7, 0.7, 0.3, 1 };
- glLightModelfv( GL_LIGHT_MODEL_AMBIENT, amb_light );
- glLightfv( GL_LIGHT0, GL_DIFFUSE, diffuse );
- glLightfv( GL_LIGHT0, GL_SPECULAR, specular );
- glEnable( GL_LIGHT0 );
- glEnable( GL_COLOR_MATERIAL );
- glShadeModel( GL_SMOOTH );
- glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
- glDepthFunc( GL_LEQUAL );
- glEnable( GL_DEPTH_TEST );
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- }
- void AnimationFunc(int value)
- {
- Rexy.WalkingCycle();
- DisplayApplication();
- glutPostRedisplay();
- glutTimerFunc(100, AnimationFunc, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment