Save mesh+children+textures to single mesh+texture

Blitz3D Forums/Blitz3D Programming/Save mesh+children+textures to single mesh+texture

LamptonWorm(Posted 2008) [#1]
Hi,

I've been working through the snippets from code archives but haven't found something that does quite what I need. I know this is a common topic, so sorry for digging it up again, I may have simply missed something obvious.

Here's what I'm trying to do - I've got a mesh with children, and the children meshes have different textures applied to them.

I want to save out to a single mesh file (e.g. b3d, .x, .3ds) and a single texture file.

I managed to get the .3ds working example, but for mesh only, can't get the textures working, and I got .b3d export example working but not with children, and for the .x export snippet I'm missing some decls so can't compile the example yet!

Cheers,
LW.


LamptonWorm(Posted 2008) [#2]
Ps. got the animated-x working ok with single .x but seperate image files, close but no cigar ;) also couldn't get the texture in the .x file to be anything other than current dir, I can change it to be .\images\blah.png easily enough but the texture doesn't load, just 'blah.png' with the image in the same folder as the .x works ok. But again, not a single image, I guess I need the single image you get from lightmapping, something I'll search for shortly. Ta!


Vertigo(Posted 2008) [#3]
You could have all of the previous textures used in a power of 2 format like 64x64 128x128 etc, then cram them onto the new 512x512 or whatever sized texture in blocks running from the top left, to right and etc. Then change the UV coords in blitz for the parts one by one as you iterate through the model you are outputting. However, I would suggest making a single texture, and UV mapping the object in an external 3d application. Then you dont even have to worry about this if youre exporting uv coords, you can put the single texture in any directory and just apply it to the entire model.

You wouldnt want to do this for levels though or anything really large(#of parts and different textures), so my guess is you should probably just do all of this from within a 3d app.


LamptonWorm(Posted 2008) [#4]
Thanks for the ideas. Cheers, LW