I am trying to do animation using glut. I have 2 squares overlapping to each other and i want other square to rotate around this central object without rotating themselves. I want to rotate in orbit manner. I am calculating circular path using parametric equation and translating that one of the square to that distance. i am calling this function in a loop.
Here is my code in which the motion of other square is not in a orbit instead it moves along a diagonal of middle one. Let me know where it is going wrong. I have added expected image as well