Log in or register to post comments

Multiple textures for a 3d model

January 9, 2012 - 10:15pm #1

Hi,

I want to use some free 3d models from the internet which provide the obj files and also the texture files. However, there are multiple texture files for the 3d model and up to now I only know how to associate one image file to a 3d model. I know that in the 3d model is broken down into different objects but how do I in the code associate a texture file to a specific object on the model?

Thanks in advance.:)

-David

Re: Multiple textures for a 3d model

January 10, 2012 - 8:38pm #2

The simplest approach is to render each texture group separately. Bind all the vertices/texcoords/etc. that correspond to one texture, and bind that texture. Render that group using glDrawElements (or glDrawArrays). Then repeat with the next group.

- Kim

Log in or register to post comments