sphere moving animation..its very urgent..thanks

does anyone have an idea how would i do an animation for the next problem?i have 2 rectangles and one sphere(as its shown in this picture(open the next link and just look at the pic))

the link:

http://poincare.matf.bg.ac.rs/~ivan/files/rg/ispiti/200910-09-zadatak.pdf

when we press some key,lets say ‘g’ the animation should start;the animation is:the sphere should move through the corridor on the path which is shown as a dotted line(it should move between those 2 rectangles)…
i have no idea how to do that,its obvious there are four different translations,i can translate it on the x-axes first but then what should i do??

can you please help…its very important,ill have an exam at my college soon and we’ll have this type of assignment!!
thanks
niko

You dare posting this in the advanced forum… come on, are you joking ?

Store the 4 corner positions in an array, then linearly interpolate position offset according to frame number (crappy) or time elapsed (way better) and use this offset in glTranslate

yeah,i know thats the idea,its quite simple,but i tried doing it that way and it just didnt work for some reason,anyway thanks for the reply,ill try to find where i made a mistake

Don’t cheat at exams, or you’ll have problems because of that later on.

haha,im not cheating,i know basics of openGL quite well,i did two big course-works in openGL regarding probability and geometry.I’m just a bit on a down side when it comes to animation,i havent done almost any of it,thats why i asked for an explanation of how this would be done,but never mind,thanks anyway,for your advices!

Google glutsetidle to find out how to do animation. Look at some examples. What U R trying to do is actually very straightforward.

yeah,it is easy,i got it right,did some basic animation too,thanks