Sign in to follow this  
LuckyOne

Strange Texture mapping problem

Recommended Posts

LuckyOne    118
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
deavik    570
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
Mercury    776
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

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