angel111
04-26-2011, 10:13 AM
hello..pls help me in moving polygon along x axis slowly....
#include<stdio.h>
#include<GL/glut.h>
#include<windows.h>
void Init()
{
glClearColor(0,0,0,0);
gluOrtho2D(0,50,0,50);
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,0.0);
glVertex2f(10,10);
glColor3f(0.0f,1.0f,0.0f);
glVertex2f(40,10);
glColor3f(0.0,0.0,1.0);
glVertex2f(25,30);
glEnd();
glFlush();
glutSwapBuffers();
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow(" hai ");
glutDisplayFunc(display);
Init();
glutMainLoop();
}
#include<stdio.h>
#include<GL/glut.h>
#include<windows.h>
void Init()
{
glClearColor(0,0,0,0);
gluOrtho2D(0,50,0,50);
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,0.0);
glVertex2f(10,10);
glColor3f(0.0f,1.0f,0.0f);
glVertex2f(40,10);
glColor3f(0.0,0.0,1.0);
glVertex2f(25,30);
glEnd();
glFlush();
glutSwapBuffers();
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow(" hai ");
glutDisplayFunc(display);
Init();
glutMainLoop();
}