I have created a body that moves in the windows of size 800,600
which moves with velocity(10,10). and that’s the init graphics function code
////////////////////////////////////////////////////////////
void InitGraphics(int argc, char *argv[]) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutInitWindowPosition(100, 100); //pass (-1, -1) for Window-Manager defaults
glutInitWindowSize(800, 800);
glutCreateWindow(“OpenGL Lab”);
glutDisplayFunc(OnDisplay);
body.P.Set(0, 0);
body.V.Set(10,10);
body.Update(0.01);
glutMainLoop();}
///////////////////////////////////////////////////////////
i want to change the velocity of the body to move in the o ppisite direction when it reach the point y=30