I have a tricky problem that i don’t know how to solve. I’m making an application that loads a figure from a .txt and then renders it. All is ok, then the application can apply a texture for the 3D figure. Well firstly i did it well, i loaded a sphere and applied it a world.bmp texture on it, and it worked very well, (i have calculated the texture coords). BUT
BUUUUT…
i Reworked the main code for the application, so i changed things and now the texture is rendered inverted. I don’t know what is causing that and i hope that somebody can point me to a possible conflict.
Here you can see better what i am talking about.
If you need portions of code to help me, i will be there.
Thanks! And sorry ofr my poor english I hope you understood me.
This can come from a lot of things.
Can you diff your before/after source codes ? If not, well, that is bad practice. You should at least try to keep some older version manually, or even better, use a version control system (SVN, …). It helps.
Usual suspects:
bmp loader, check in-memory representation
texture coordinates, as well as texture matrix.
backface culling (maybe everything is correct, but you see only backfaces)
model and viewport transformations : glScale, gl*Matrix, gluPerspective… (strong suspect)
I know that i should use a version control system but well you know im in the university and i dont know how SVN works yet. But when i finish those examns i will go to try SVN.
Well
Usual suspects:
bmp loader, check in-memory representation (I think that no, i didn’t touched the loader)
texture coordinates, as well as texture matrix.
(i have figures with the texture coordinates precalculated, and i didnt changed anything) Texture matrix? can you explain me more?
backface culling (maybe everything is correct, but you see only backfaces)
well yes, but i dont suspect that is this.
model and viewport transformations : glScale, gl*Matrix, gluPerspective… (strong suspect)
Yes, i touched a lot of these ^^U…
screen shot program (probably not)
Ok i go to eat something, then i will upload some code i hope this will clear something.
Even without SVN, keeping older copies on your work on dated directories is good practice. Memory is cheap.
work/assignment31 // <- current working directory
work/assignment31_2008-12-02 // yesterday
work/assignment31_2008-11-25 // older …
work/assignment31_2008-11-15
…
Texture matrix? can you explain me more?
Yeah sure, there are 3 transformation matrices in opengl : projection, modelview, and texture matrix. But your problem is more likely to be in the other transformations.