title: Implementing movement of tree leaves with wind in OpenGL
body: <p>I am trying to implement an OpenGL program which will show the movement of leaves of a tree with the wind.As a starting point I have written the following idle() function</p>
  
  <pre><code>zh=0;
  
  void idle()
   {
    double t=glutGet(GLUT_ELAPSED_TIME)/1000.0;
    zh=sin(t);
    glutPostRedisplay();
   }
  </code></pre>
  
  <p>for the vertices used to form the leaves I tried using</p>
  
  <pre><code>glVertex3f(x,y,z+zh);
  </code></pre>
  
  <p>using <code>zh=sint(t)</code> does not provide the desired movement of leaves with wind.Could anyone suggest any other equation that might work well?</p>