gluSphere and quadratic objects
Dear All,
I posted a question a little while ago (entitled "gl animation too slow"). Thanks for all the suggestions.
I have another related question, which might help me speed things up.
In my code, I call gluSphere several thousand times (:eek: ), but I can't allow this to take long.
I see that gluSphere takes a GLUquadricObj as a parameter. Does this mean that the sphere is now stored in this quadratic object? If so, then since I want all my spheres to look the same, can I re-use that objcet, rather than calling gluSphere time and again?
If so, how? I don't know how I would re-render such an object. (Re-render is probably not the word I should use - I hope you understand what I mean).
Thanks everyone,
Phil Drew
If it helps, here's my code again:
Code:
::glNewList(1,GL_COMPILE_AND_EXECUTE);
for(i=0; i<m_ppf; i++)
{
n = m_ppf*f + i;
X = m_x[n];
Y = m_y[n];
Z = m_z[n];
glPushMatrix();
glTranslated(X, Y, Z);
glColor3f(1.0f,1.0f,1.0f);
glMaterialfv(GL_FRONT,GL_DIFFUSE,farraygrey);
gluSphere(m_quadratic, m_radius, m_quality+1, m_quality+1);
glPopMatrix();
}
::glEndList();