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.

Dark GDK / Multiple textures on a .x object

Author
Message
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 6th Jan 2011 07:53
I am creating custom models in blender and want to apply multiple textures to them. How would I load these objects and textures from DarkGDK? or is it even possible? If I can't do this with .x models, how can this be achieved short of creating multiple objects every time I need to use a different texture?
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 6th Jan 2011 14:39
If your .x object has multiple "limbs" then each "limb" can have it's own texture. I'm afraid if you have multiple textures on a single "limb", GDK won't do them right. My suggestion is to load the .x with no texture assignments and load the textures seperately, then do a dbTextureLimb() for each limb and texture stage..... I know it seems the long way around, but it works. Make a function for loading your .x and include the texture loading and assignment.

The fastest code is the code never written.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 7th Jan 2011 00:58
Anyone have or know of a good limb tutorial? It's something I've been meaning to learn anyways... Guess I need to get to it.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Jan 2011 02:51
It's actually pretty simple (for texturing). You need to know which limb you want to texture with what texture. The easiest way is through trial and error if you are working with only a few objects.
dbTextureLimb ( int iObject, int iLimb, int iImage );
simply rotate through the "iLimb" and figure out what image goes with what limb. Keep track of the info and put it into your code. Don't worry, each time you load that object, the limb assignments will be the same unless you change something.
Alternatively, you can look for the limb name and match it with a texture using dbLimbName( int iObject, int iLimb):



3DSMax lets you name the limbs. I don't know what other 3D editors do.....

The fastest code is the code never written.
Parry
AGK Developer
14
Years of Service
User Offline
Joined: 16th Dec 2009
Location: Swampstone
Posted: 9th Jan 2011 13:48
Have you seen this?

http://forum.thegamecreators.com/?m=forum_view&t=164528&b=22
Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 9th Jan 2011 15:31
@Parry: That's a very slow and ineffecient way of applying textures on the fly, you are better of with limb texturing, faster, less chance on mem leaks, less code.

Login to post a reply

Server time is: 2024-11-19 14:43:52
Your offset time is: 2024-11-19 14:43:52