OpenGL programs done in lab
Circle moves clockwise around a line using right arrow. Logic is simple, at the endpoints of line the velocity direction gets reversed, the y-axis position is also changed by 2 * Radius.
I used glScalef function to scale the image
We have to enable stippled lines
I simply store all the points while the LMB is pressed and clear the screen when RMB is pressed. I use small connected line segments (GL_LINE_STRIP) to draw the curves