iDevGames Forums
Texturing challenge - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Texturing challenge (/thread-2294.html)

Texturing challenge - bmantzey - Oct 14, 2008 08:20 AM

I've got a train mesh that loads as one object, so I have one array to work with. I have 5 textures to apply to it in different places. There's a texture for the engine and a different texture for each of its cars. Also, there's a texture for the wheels and a second texture for the engine. Help! Annoyed

Texturing challenge - maximile - Oct 14, 2008 10:00 AM

I guess it depends on what you mean by "loads as one object". How are you loading the mesh?

You could put all your textures into one image and offset the texture coordinates, or you could just have an array for each object (slightly slower but simpler).

Texturing challenge - bmantzey - Oct 14, 2008 10:14 AM

It's a 3ds file and I have an exporter that writes all the data out to a text file in C++ code so that all I have to do is include the exported file and pass in the written array pointer to OpenGL.

The mesh is all one piece, the index array is all one array. So, it isn't broken up in any way.

Texturing challenge - maximile - Oct 14, 2008 10:57 AM

Could you just export each object separately?

Otherwise you're going to have to find another exporter that supports multiple textures or start editing the C++ file that it exports (which might be fairly annoying or almost impossible depending on how it formats it).

Anyway, you're not going to be able to change texture in the middle of drawing a vertex array (AFAIK), and even if you could you'd still need a way to work out which vertices applied to each object.

Texturing challenge - bmantzey - Oct 14, 2008 11:50 AM

That's what I thought. Thanks!