Jump to content
  • Advertisement
Sign in to follow this  
Beaverbutt8

What to do now

This topic is 4590 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

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

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

[/quote]

Try to find some documentation of the library you're using...[/quote]

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



Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!