Advertisement Jump to content
Sign in to follow this  
ajm113

Rescale Textures On Models

This topic is 3647 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am trying to redesign the look of a sphere in my game where when I do something like this with rescaling the texture.
glMatrixMode(GL_TEXTURE);
   
    glScalef(1,1,1);
glMAtrixMode(GL_MODELVIEW);





But when I add that before the sphere code it seems the textures resizing with the model moving and also messed up other models as well. All The Code:
glDisable(GL_CULL_FACE);
	glEnable(GL_FRONT_FACE);
		glEnable(GL_TEXTURE_2D);
	glEnable(GL_BLEND);
		
		GLUquadric* q2 = gluNewQuadric();
		glBindTexture(GL_TEXTURE_2D, texture[8].texID);




		glPushMatrix();


    //Texture Rescale Was Here

			glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
			glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
			gluQuadricDrawStyle(q2, GLU_FILL);
			gluQuadricTexture(q2, GL_TRUE);
			glRotatef(GalexyRotate, -1, 0, 0);
			glTranslatef(0, 0, 0);
			
			gluSphere(q2, 400.0f, 10, 12);


	glPopMatrix();
    	glDisable(GL_TEXTURE_2D);
	glDisable(GL_BLEND);

	GalexyRotate -= (float)1.0*m_dTimeDelta;
	if(GalexyRotate <= -360){
	GalexyRotate = 0.0f;
	}

			glNormal3f(1.0f,1.0f,1.0f);
			glColor3f(1,1,1);
		

			glDisable(GL_FRONT_FACE);
	 	glEnable(GL_CULL_FACE);	





Im trying to create a sphere sky with a galaxy texture on it. Thanks, Andrew. [Edited by - ajm113 on January 24, 2009 7:54:12 PM]

Share this post


Link to post
Share on other sites
Advertisement
Thats not re-scaling the texture, its re-scaling the texture coordinates. Which is gonna F everything up. Is that what you want to do, or do u want to scale a texture bigger?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!