Hi, im programing in 3D, but ALL my models(aprox. 13) have the texture rotated. Anyone knows what causes this problem ?
Where y can find 3D Tutorials for LIBNDS ?
[3D]The Textures Are Rotated 90º
-
- Posts: 19
- Joined: Wed Apr 15, 2009 3:17 pm
Re: [3D]The Textures Are Rotated 90º
First, how do you load your textures ?
2) Look for tutorial for OpenGL, they will help you
2) Look for tutorial for OpenGL, they will help you
Re: [3D]The Textures Are Rotated 90º
I don't have any texture rotation problem here...
Well, without any code or details it's hard to help (screenshots of expected and actual results might help too).90 being the angle you want to rotate them, but it could be -90 depending on the way you want them to go.
This should only have to be done once, except if you modify the texture matrix again.
But if you want to change that matrix a few times, it might be good to build a rotation matrix, store it and use it (instead of the two matrix modifications above) :(see http://www.opengl.org/documentation/spe ... otate.html for the GL rotation matrix equations)
Prepare your matrix once and keep it some place safe
Then :This will save you the matrix multiplication on each set.
Have fun !
Well, without any code or details it's hard to help (screenshots of expected and actual results might help too).
- What's your texture format?
- Are you sure you UV are ok ?
- What 3D software are you using and which exporter ?
- Any specific mesh format used ?
Code: Select all
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glRotatef(90.0f,0.0f,0.0f,1.0f);
glMatrixMode(GL_MODELVIEW);
This should only have to be done once, except if you modify the texture matrix again.
But if you want to change that matrix a few times, it might be good to build a rotation matrix, store it and use it (instead of the two matrix modifications above) :
Code: Select all
float textureMatrix[16];
Prepare your matrix once and keep it some place safe
Then :
Code: Select all
glMatrixMode(GL_TEXTURE);
glLoadMatrix(textureMatrix);
glMatrixMode(GL_MODELVIEW);
Have fun !
try, crash, debug and learn
Who is online
Users browsing this forum: No registered users and 1 guest