Programing the compound 3d object (grain sorter)

So I need program it. There should 4 open boxes for sorting different size with it rectagon basis. So I have idea to draw this part by rect faces. But How I can define coordinates if the the origin is at lower left (So I can to pre-calculate). Then in the middle part there should be the animation of grain than is falling vertically and then slides horizontally to sorting boxes. So the next important task it to create the particles. It is about creation the bunch of grain parttickes at the origin of some kind of methal box with unsorted grain than they move vertically (let it be without gravity acceleration) and reach sliding plane with constant speed so I need cue for such animation (exceopt grain in boxes should be also visible as the heap). Then this flying looping plane should be rotating and slides on two cylinders on right and left (So how to create cylinder as predefinder or with trygonometry I know but how to define its coordinates–as default is 0.0). Should it be done by gltranslate but it is ppalicable to the vertex but how to whole cylinder. Then this sliding plane is like extruded (cut-out) rounded rectangle–so I do not know algorith for its creation (especially if to take into account it should be moving–but I drop it). So here is the issues of rounded rectangle extruded and its coordinates–it cound be one semi-cylinder at right and to olaes in the middle and another semi-cylinder at left. So what could you advise. Is it possible to in Opengl especialaly animation and cylindrical bodies.

So the first thing I want to know. How to program the extruded curvy rectangle. So it is like the extruded football stadium? Can anyone refer to the formula. As for the front and back facets -the curved rectange itself and the other sides of such objects. Despite the question for cylinder is also important now.