1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| void Viewer::drawScence(){
glClearColor (0.f,0.f,1.0f,1.f);
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode (GL_PROJECTION);
glFrustumf (-1000.f,1000.f,-1000.f,1000.f,3.f,1000.f);
glMatrixMode (GL_MODELVIEW);
glShadeModel (GL_SMOOTH);
glEnableClientState (GL_VERTEX_ARRAY);
glTranslatef (0,0,-5.f);
glColor4f(0,1,0,1);
static const GLfloat vertices[3 * 3] =
{
-1000, 1000, 0,
1000, -1000, 0,
1000, 1000, 0
};
static const GLubyte colors[3*4] = {
255, 0, 0, 255,
0, 255, 0, 255,
0, 0, 255, 255
};
glVertexPointer( 3, GL_FLOAT, 0, vertices );
glDrawArrays( GL_LINES, 0, 2);
} |
Partager