Search code examples
copenglglutopengl-4

knapsack ComputerGraphics cg opengl


I'm trying to implement knapsack using OpenGL. I'm generating balls of given weight and profit taking values from the user, and then draw balls on the screen. I want to send the balls which are selected into a box but I'm not at all able to move the ball. Can you suggest a way to move a ball from point A to point B forming a trajectory in 2d?

https://drive.google.com/open?id=1JIowM4NGLGOFWKosk6VTIB3SDGF4D_WI


Solution

  • I think linear interpolation is what you need.