Sign in to follow this  

Strange Texture mapping problem

This topic is 4393 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

As you can see texture is not mapped corectly, why? Im using this code for 2d mode:
w = 640;
h = 480;
	Gl.glTexCoord2f(0.0f, 1.0f); Gl.glVertex2f(0, 0);
	Gl.glTexCoord2f(0.0f, 0.0f); Gl.glVertex2f(0, h);
	Gl.glTexCoord2f(1.0f, 0.0f); Gl.glVertex2f(w, h);
	Gl.glTexCoord2f(1.0f, 1.0f); Gl.glVertex2f(w, 0);





Share this post


Link to post
Share on other sites
I don't exactly see what's wrong (it's a spinning cube right?), but most probably the texturing coordinates have been flipped. So you coule try:

Gl.glTexCoord2f(0.0f, 0.0f); Gl.glVertex2f(0, 0);
Gl.glTexCoord2f(0.0f, 1.0f); Gl.glVertex2f(0, h);
Gl.glTexCoord2f(1.0f, 1.0f); Gl.glVertex2f(w, h);
Gl.glTexCoord2f(1.0f, 0.0f); Gl.glVertex2f(w, 0);

Share this post


Link to post
Share on other sites
It's probably the loading code, but check to make sure it's not the actual texture. Many a coder has been tricked by trying to debug working code when the data is borked. [razz]

Share this post


Link to post
Share on other sites

This topic is 4393 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this