I'm trying to make a game which allows the user to rotate a canon thats sitting at the center of my window and shoot whenever they like.

Code:
void rotate_canon(int direction)
{
                if ((direction == LEFT) && (canon_yaw < 90))
                {
                        canon_yaw += 5;
                }
                else if ((direction == RIGHT) && (canon_yaw > -90))
                {
                        canon_yaw -= 5;
                }
                else if ((direction == UP) && (canon_pitch < 90))
                {
                        canon_pitch +=5;
                }
                else if ((direction == DOWN) && (canon_pitch > -90))
                {
                        canon_pitch -=5;
                }

                draw_canon();
}
rotates the canon

Code:
void draw_canon()
{
        /* Only redraw the part that is changing */
        glPushMatrix();

        glEnable(GL_SCISSOR_TEST);
        glScissor(0, TEXTHEIGHT, WIDTH, HEIGHT);

        glDisable(GL_SCISSOR_TEST);

        glMatrixMode(GL_PROJECTION);

        glLoadIdentity();
        glViewport(0, 0, WIDTH, HEIGHT);
        gluPerspective(45.0, 1.0, 1.0, 300.0);

        gluLookAt(
                0.0, 0.0, 30.0,
                0.0, 0.0, 0.0,
                0.0, 1.0, 0.0);

        glRotatef(canon_pitch, 1.0, 0.0, 0.0);
        glRotatef(canon_yaw, 0.0, 1.0, 0.0);

        glBegin(GL_QUADS);
                glColor3f(0.0, 0.0, 1.0);

                /* canon front */
                glVertex3f(-0.5, -0.5,  -1.5);
                glVertex3f( 0.5, -0.5,  -1.5);
                glVertex3f( 0.5,  0.5,  -1.5);
                glVertex3f(-0.5,  0.5,  -1.5);

                // canon back */
                glVertex3f(-0.5, -0.5, -0.5);
                glVertex3f(-0.5,  0.5, -0.5);
                glVertex3f( 0.5,  0.5, -0.5);
                glVertex3f( 0.5, -0.5, -0.5);

                /* canon left */
                glVertex3f(-0.5, -0.5,  0.5);
                glVertex3f(-0.5,  0.5,  0.5);
                glVertex3f(-0.5,  0.5, -2.0);
                glVertex3f(-0.5, -0.5, -2.0);

                /* canon right */
                glVertex3f( 0.5, -0.5, -2.0);
                glVertex3f( 0.5,  0.5, -2.0);
                glVertex3f( 0.5,  0.5,  0.5);
                glVertex3f( 0.5, -0.5,  0.5);

                glColor3f(0.2, 0.0, 1.0);

                /* canon top */
                glVertex3f(-0.5,  0.5,  0.5);
                glVertex3f( 0.5,  0.5,  0.5);
                glVertex3f( 0.5,  0.5, -2.0);
                glVertex3f(-0.5,  0.5, -2.0);

                /* canon bottom */
                glVertex3f(-0.5, -0.5,  0.5);
                glVertex3f(-0.5, -0.5, -2.0);
                glVertex3f( 0.5, -0.5, -2.0);
                glVertex3f( 0.5, -0.5,  0.5);
        glEnd();

        glPopMatrix();

        glFlush();
}
draws the canon
everything is working good so far.

my question is, when the user clicks to fire....how can I find out where to draw a sphere that represents the canonball (front center of the gun is where?). and how can I determine a trajectory for the shot, so I will be able to update it, and have it seem like its moving.