Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


rotate


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 mentaman   Members   -  Reputation: 99

Like
0Likes
Like

Posted 22 December 2011 - 04:59 AM

when I rotate the player it draws tree black lines:
Posted Image


When I don't rotate the player, he doesn't have this lines...

This the rotate code:
if(ySpeed != 0 || xSpeed != 0)
				deg = fmod(atan2(yP-(yP+ySpeed),xP-(xP+xSpeed))/3.14159265f*180.f,360.f);
			glPushAttrib(GL_TRANSFORM_BIT);
			glMatrixMode(GL_TEXTURE);
			glLoadIdentity();
			glPushMatrix();
			glTranslatef(0.5f, 0.5f, 0.f);
			glRotatef(deg, 0.f, 0.f, 1.f);
			glTranslatef(-0.5f,-0.5f, 0.f);
			glMatrixMode(GL_MODELVIEW); 
			glPopAttrib();

		
		glEnable (GL_BLEND);
		glColor4f(1.0f,1.0f,1.0f,1.0f);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		
		glBegin(GL_QUADS);				//draw...
			glTexCoord2d(1.0,1.0);glVertex3f( xP, yP2,  0);
			glTexCoord2d(0.0,1.0);glVertex3f( xP2, yP2, 0);
			glTexCoord2d(0.0,0.0);glVertex3f( xP2, yP, 0);
			glTexCoord2d(1.0,0.0);glVertex3f( xP, yP,  0);
		glEnd();
		

		glMatrixMode(GL_TEXTURE);
		glPopMatrix();

		glMatrixMode(GL_MODELVIEW); 		glDisable (GL_BLEND);


Sponsor:

#2 Sik_the_hedgehog   Crossbones+   -  Reputation: 1807

Like
1Likes
Like

Posted 01 January 2012 - 06:42 AM

It's trying to render what's beyond the texture. Because the wrapping mode is "clamp", it'll extend what's in the borders (if it was "repeat", you'd get tiling instead).

Why are you rotating the texture instead of the polygon?

EDIT: just noticed I replied to a more than one week old post >_>' (well, still not very old)
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS