Falling grain animation in grain sorter

So i do understand and made 3d object. But what about the falling particles (corns)? Here is fine example https://www.opengl.org/discussion_boards/showthread.php/139968-falling-raining-objects--about falling particles, but the thread is closed. So I ask the question that was refered there. There was told that we just need to substract the Y coordinates untill some vertical level and redraw. So how it should be correctly written? position.y[]=position.y[]-velocity*k----display()
{
drawing code
glutSwapBuffers()
}
or it should be called glutPostRedisplay?
2.Then that threat writes that untill reaching some level the point shout reset to initial level--so how to do it? if (position.y=1) position.y=rand() (A-B)+B?
3. On grain sorter there is also gorizontal moving after vertical? so should we make ydirection unmovable with adding the (-v)--as the opposite velocity to initial one, then to add the x-dimension? Then again x-unmovable and Y-faaling untill some level and reset.
4. and last question--how i should draw the static 3d object and animation. Should it be compound in
display function. Or I can make two mathods to place there--one for static object and second one for animation? So how should look the init() function?
Topic archived. No new replies allowed.