title: texturing a glutSolidSphere
body: <p>I need to add an earth texture to a glutSolidSphere. The problem is that I cannot figure out how to make the texture stretch over the entire sphere and still be able to rotate. </p>
  
  <p>We're enabling the textures with.  </p>
  
  <pre><code>glTexGeni(GL_S, GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
  
  glEnable(GL_TEXTURE_2D);
  
  glEnable(GL_TEXTURE_GEN_S);
  glEnable(GL_TEXTURE_GEN_T);
  
  //drawcode...
  </code></pre>
  
  <p>using GL_SPHERE_MAP in param instead of GL_OBJECT_LINEAR makes the textures look proper, but they cannot rotate.</p>
  
  <p>The parameters I use for the texture are</p>
  
  <pre><code>glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  </code></pre>
  
  <p>I understand that GL_REPEAT tiles the texture, while using GL_CLAMP instead gives me the texture once on the object, but I cannot get it to stretch over the whole sphere.</p>
  
  <p>Does anyone know how to properly texture a glutSolidSphere?</p>