VASIMR
04-28-2011, 04:27 PM
Hi,
I am having two issues with some OpenGL code.
One is moving textures on a gluSphere. What I mean by this is, as the camera or object moves around, the texture seems to rotate on the surface so that one point is always looking at the camera. My code is as follows.
GLUquadricObj *sphere = gluNewQuadric();
gluQuadricDrawStyle(sphere, GLU_FILL);
gluQuadricTexture(sphere, TRUE);
gluQuadricNormals(sphere, GLU_SMOOTH);
glBindTexture(GL_TEXTURE_2D, SystemTexture[SROCKY] );
gluSphere(sphere, SMALL_PLANET_RADIUS, STAR_SEGMENTS, STAR_SEGMENTS);
gluDeleteQuadric(sphere);
The other problem that I am having is with the render order. Is there a function or an algorithm to make objects that are further away from the camera render behind closer objects, given that the camera can move?
I apologize if the questions have already been answered, if that is the case, please point me in the right direction.
Thanks!
I am having two issues with some OpenGL code.
One is moving textures on a gluSphere. What I mean by this is, as the camera or object moves around, the texture seems to rotate on the surface so that one point is always looking at the camera. My code is as follows.
GLUquadricObj *sphere = gluNewQuadric();
gluQuadricDrawStyle(sphere, GLU_FILL);
gluQuadricTexture(sphere, TRUE);
gluQuadricNormals(sphere, GLU_SMOOTH);
glBindTexture(GL_TEXTURE_2D, SystemTexture[SROCKY] );
gluSphere(sphere, SMALL_PLANET_RADIUS, STAR_SEGMENTS, STAR_SEGMENTS);
gluDeleteQuadric(sphere);
The other problem that I am having is with the render order. Is there a function or an algorithm to make objects that are further away from the camera render behind closer objects, given that the camera can move?
I apologize if the questions have already been answered, if that is the case, please point me in the right direction.
Thanks!