• Advertisement
Sign in to follow this  

loading multiple .x files

This topic is 4182 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Every tutorial I come across for loading a .x mesh isn't what I want. It's radically different loading in a single .x file compared to making a function that will load any number of .x files I want. I do not know how to program this and every attempt I make at it, I fail. It just doesn't seem so easy to make the load .x function into a function that will accept the name of a .x file as a parameter that I can pass to it and have it also store all the textures and materials properly. Ugh!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Every tutorial I come across for loading a .x mesh isn't what I want. It's radically different loading in a single .x file compared to making a function that will load any number of .x files I want.

It shouldn't be radically different. Once you figure out how to load a single X file, you should know enough to abstract it.

Quote:
I do not know how to program this and every attempt I make at it, I fail.

If you have specific problems creating the abstraction, share it and we'll try to help. [smile]

You already have code that loads a single mesh, so you know what kind of 'data' is stored in the end (e.g. materials and textures). It should be simple enough to create a class that wraps this up.

Share this post


Link to post
Share on other sites

I don't know which programming language are you working with, but if you are using C++ or VB I suggest you create a class (or typedef struct in VB) where you store your Mesh, a vector of materials, textures, and so on. This way it will make it a lot easier for you to save all the data you need and render it afterwards. So, when you need to call your .x loading function you just need to store all your info in an object of that class...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement