Sign in to follow this  
sixteen

loading multiple .x files

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this