Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Multiple textures on one mesh

Author
Message
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 24th Jul 2020 17:30
I have a box (as a placeholder test) which has a different texture per face, when I load it into AppGameKit all I get is a white box and setting the object image sets all faces as that texture.

Is there a way to texture each face using a separate texture?

I want to have a big room which will use loads of textures and having them all on one big texture is not an ideal situation. I have loaded into Unity and it works as required.
-EdzUp
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 24th Jul 2020 19:03
Ypu have to load the more using LoadObjectWithChildren, then if its built correctly you will be able to access the individual meshes. .obj files I have found a pain, .X and .fbx work best.
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 24th Jul 2020 19:07 Edited at: 24th Jul 2020 19:08
You dont have to loadwithchildren to get multiple meshes. (only really for animation and children). Just LoadObject will load multiple meshes into the one object.

You will have to use SetObjectMeshimage() multiple times though. Once for every mesh in the model. You can use GetObjectNummeshes() to check you have all 6 sides.

You can then set an individual image per face with SetObjectMeshimage().
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 24th Jul 2020 20:19
Thanks guys will have a look
-EdzUp
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 25th Jul 2020 18:12
Thanks Bengismo worked like a charm
-EdzUp
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 25th Jul 2020 22:59
I'll have to go back to this....normal load object never worked for multiple meshes for me, perhaps its just the .obj format I'm saving in.
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 26th Jul 2020 19:58 Edited at: 28th Jul 2020 04:05
I use dae format
-EdzUp
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 27th Jul 2020 00:27
I thi k the issue is materials I had, and possible MilkShape. It seems that, according to documentation, AppGameKit loads models using the lowest amount of meshes possible, and it seems to do this via materials. What I've found is a model with 3 meshes with no materials set as a .obj format loads with one mesh. If you set them with 3 different materials and save them (not UVs) then you get the 3 meshes. If two meshes share the same material, you get two meshes, one for each material. So it seems AppGameKit uses material data to decide how many meshes to have.

So the rule seems to be use a modelling program to set up materials....or use something better than MilkShape.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Jul 2020 02:07
The .obj format can have groups and objects. Maybe it's exporting your meshes as groups?
Do you have a sample .obj file?
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 28th Jul 2020 04:07
If you use milkshake also use something like Ultimate Unwrap to texture as milkshake can muck up some of the exporting.
-EdzUp
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 28th Jul 2020 17:24
I use Blender for modelling and UV mapping, I only use MilkShape for exporting as the newest Blender doesnt have .X exporting yet.
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 29th Jul 2020 18:02
Ultimate unwrap has x exporting iĆ­rc
-EdzUp

Login to post a reply

Server time is: 2024-11-22 00:11:24
Your offset time is: 2024-11-22 00:11:24