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 / How do i make custom texture locations

Author
Message
FlexiCat
14
Years of Service
User Offline
Joined: 15th Jun 2010
Location:
Posted: 15th Jun 2010 21:01
I am very new to using Dark GDK and a lot of the stuff required to work on a 3d game in such fashion, so please allow me to apologize if my inquiry is flawed in intellectual value.

To the point. I have messed around with some basic 3d modeling with some of the modelers that TGC offers and have not found a way to organize, and separate, textures that are to associated with the models. I realize some time I am not always clear with my explanations so, what i want simply: the game.exe is in a folder in that folder is another called DATA and withing that two folders one called Textures the other called Models. I think you get what i am talking about.

It could be that i am utilizing the models incorrectly or some such.

Any assistance in this would be very appreciated, Thanks in advance.

I swear to the programmers bible that I shall not harm the FPS.
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 15th Jun 2010 23:43
Can you not load the models and textures seperately and apply the texture at runtime?

Your signature has been erased by a mod because it's larger than 600x120
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 16th Jun 2010 05:58
If I understand correctly, you are wanting to have it so that your game/app loads the model and texture from their respective locations(In your example from two separate folders), and have the texture applied to the model. This is quite simple, as long as you have your model already UV mapped, and know the relative path to the items.

First you would load up the model, normally you would have just the name of the model, but since you want to use a folder structure, you have to put the path as well. In your case it would look something like this:

dbLoadObject("DATA/Models/modelnamehere.x", object_ID);

next you would load your texture, this is the same as loading your model:

dbLoadImage("DATA/Textures/texturenamehere.bmp", texture_ID);

finally all you would need to do is call the texturing command:

dbTextureObject(object_ID, texture_ID);

and that should work, if I am not mistaken.

If you don't want to worry about doing all of that, my suggestion if you are using .x files would be to actually edit the texture file name part in the file itself. This is easier than it sounds. Simply open up the file in a text editor (ie: notepad) and find the item tagged as "TextureFileName", a simple ctrl-f and typing in texture would do the trick. next change the name of the file to the relative path, in this case:

from this: "filename.bmp"

to this: "../Textures/filename.bmp"

the two dots represent going to the parent folder (the one before the current folder).

Hope that helps
-H

FlexiCat
14
Years of Service
User Offline
Joined: 15th Jun 2010
Location:
Posted: 12th Jul 2010 04:43
Quote: "If you don't want to worry about doing all of that, my suggestion if you are using .x files would be to actually edit the texture file name part in the file itself."


This is what i was looking for. i did not know i could do it in the code, but i hadent really checked. i have been modeling .x files and texturing them with the modeller so this answer was exactly what i was looking for.

Thanks very much. sorry for the late response, been sick.

I swear to the programmers bible that I shall not harm the FPS.

Login to post a reply

Server time is: 2024-11-19 23:19:59
Your offset time is: 2024-11-19 23:19:59