What to do now

Started by
17 comments, last by ZMaster 18 years, 4 months ago
Hey guys, I found a 3ds loader on some site called space simulator. It works pretty well. The problem is that it's several C++ and .h files. So, how would i use it in my game? Thanks :) And Happy Thanksgiving :) Mike
Advertisement
If I understand correct, what you have is a library source.

You can try to make a new library project, add all the .cpp files to it,
make sure the .h files are visible to your project, and compile it.

The result should be a .lib file, which you will include/link with your original project.

Happy Thanksgiving :)
Hi bud,

You could use visual studio to build the code into a static library. That way when you want several other projects to use the same code, you can use the header files as they are and link in the library.

Hope that helps,

ace
So, once i do that, i can just type something like load( "model.3ds" )????
Quote:Original post by Beaverbutt8
So, once i do that, i can just type something like load( "model.3ds" )????


That depends on the implementation of the loader, but generally: yes.
Function naming conventions may somehow be different but if you're really talking about a loader library here, something like load("...") is possible.
Try to find some documentation of the library you're using...



Try to find some documentation of the library you're using...

Ok, it's starting to make sense. The library i use has no documentation. Could you reccomend a 3ds loader library for OpenGL? I'm using dev cpp if that helps.








Happy Thanksgiving :)


Mike



I can't help you as far as a better-documented / more popular loader, but I suggest you read the code of the loader you have... look at the functions, see if they're commented saying what they do - and if not, try and figure out what each function actually does... that's all a library is, you're just calling the functions of the library from your computer. It might not be soo important to know exactly what a model loader is doing - but then again, it's a great way to learn about how it all happens. After all, the main way you learn to code is by reading and understanding code - so why skip over this code just because is might not be as neatly wrapped?
If you want to learn how it's done then check out this fantastic tutorial. It explains everything and how to use it, and you even get source code to include in your own project!

Good luck to you.
Thats exactly the source code i'm using. But, i'll try to go over it again. When i tried to compile it, i got dozens of errors.

The example* files, containing main(...), is probably just a testbed for the library.

All you need to do realy is to add 3dsloader.cpp/h and texture.cpp/h to your project as if you had written them yourself.

EDIT:
Wait a second... I get it... you are compiling the whole thing as it is, right?
If so, there is probably not any "serious" errors to deal with, just a few adjustments.

This topic is closed to new replies.

Advertisement