OpenGL motion curve animation