draw object in 3 dimensions with openGL C++

Hello all,

it’s been a while since I have not done C + + and a fortiori the openGL. In the past i made sphere but now I try to do several things (in different coordinates) with a little more complex forms.

=> Example : I will like to start by making several ellipsoids with differents directions orientation.

the problem is that I do not know how to do this, it sounds complicated to me, no …?

Thank you in advance for the help you can give me

A +

ps: this is my code for spheres, how i can modify them to have ellipsoides ?

GLUquadric* sphere;
    QVector <GLUquadric*> params;
    for ( int k = 0 ; k < 400 ; ++k )
    //--------------------------------tirage au sort des coordonnées-------------------------------------
    //on initialise le temps
    //Et dans la boucle on utilise tirage entre -5000 et +5000 puis en divise par 1000
    float c1=0.0;
    float c2=0.0;
    float c3=0.0;
    int e=0;
    for ( int k = 0 ; k < globalNb ; ++k )
        for ( int i = 0 ; i < 200 ; ++i )
            c1 =((qrand() % (5000-(-5000)+1)) + (-5000))/10000.0;
            c2 =((qrand() % (5000-(-5000)+1)) + (-5000))/10000.0;
            c3 =((qrand() % (5000-(-5000)+1)) + (-5000))/10000.0;

            //tracer de la sphere
            glPushMatrix( );//save axis system
            glPopMatrix( ); //load the saved matrix

Look to add glRotate and glScale to the glTranslate

thanks a lot for your help !

=> if i understand i have to put at the end of my code something like this ?

glPushMatrix( );//save axis system
glPopMatrix( ); //load the saved matrix

Just remember the order of glTranslatef, glScalef, glRotated is important as you get different effect depending on the order you use. (I always get mine wrong!!)