gchris
Posts: 4
Joined: Tue Feb 12, 2013 12:30 pm

MD5 model back and front textures appear in same position

Tue Feb 12, 2013 12:40 pm

Hi,

I have loaded an MD5 model on the raspberry pi. Once the model has loaded I apply a scale and rotation to it so it appears well within the screen and looking the right way but which ever way I rotate it the front and back textures follow each other round. For example if I rotated it so the front was visible then the back textures would be mainly visible with the front textures poking through. I am pretty sure I have inputted the vertex coordinates correctly. Thanks in advance for the help.

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: MD5 model back and front textures appear in same positio

Tue Feb 12, 2013 2:07 pm

Your triangle order is probably reversed. This happens when using DirectX/XNA code on OpenGL as they have different winding orders. You are seeing through the front of your model and rendering its interior.

To verify if this is your issue, swap the last two triangle indices/vertices so that a, b, c becomes a, c, b or use glCullFace (http://www.opengl.org/sdk/docs/man/xhtml/glCullFace.xml) with a setting of GL_FRONT.

gchris
Posts: 4
Joined: Tue Feb 12, 2013 12:30 pm

Re: MD5 model back and front textures appear in same positio

Tue Feb 12, 2013 2:55 pm

Thank you so much OtherCrashOverride it works perfectly! :D

Return to “OpenGLES”