Jump to content
  • Advertisement
Sign in to follow this  
leo77

OpenGL 3ds loader - objects misplaced and other problems...

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

I 've built my own 3DS loader (in C++ openGL) based on the one from www.gametutorials.com and while most models load fine, some models get split up into several 'pieces'. Besides, there are models that doesn't even load (the ones I "cloned" when I was building the model) and there are also models with the texture mapped incorrectly (the bottle from the first tutorial -animating still life- is loaded with a white texture, and the label in the bottle is not well mapped -looks like it was "cut to fit"). It seems theres nothing wrong with the model itself because MAX load it fine. How can I correct these errors? or, is there a 3ds loader that works fine (tutorial or simply a source code...)? thanks in advance...

Share this post


Link to post
Share on other sites
Advertisement
The most effective way to load 3ds models is to write a Max exporter to export a file in your own format (or a well-known format) rather than trying to reverse engineer the 3ds format.

Share this post


Link to post
Share on other sites
Quote:
Original post by leo77
or, is there a 3ds loader that works fine (tutorial or simply a source code...)?


Yes, you can get a great one at ultimategameprogramming. Click on "Tutorials"->"OpenGL"->"Page 8"->"3DS Loader".

Or, the one I have been working with as of now is this one off of APRON. Good stuff.

- Drew

Share this post


Link to post
Share on other sites
I wish I could tell you exactly what is wrong in all those cases, but that's kind of tough. However, I've found that the easiest way find out what is wrong is to open up the model file in notepad/wordpad and actually look at what is being exported (assuming you can create an ascii version).

Like the white texture ussually means the texture didn't get exported or is missing from the project.

And for stuff like the model that doesn't show up, you can check to see what exactly is getting exported, and then look at how your model loader would interpret that data.

Sorry I couldn't be more specific. Best of luck though!

Matt Hughson

Share this post


Link to post
Share on other sites
Hi...

I tryed to load my model with the tutorials suggested by Drew_Benton but the one from ultimategameprogramming had the same problem (objects got split up, and some texture problems), and the one from APRON had an error when I was trying to execute it in VC .NET (stack around the variable version corrupted).

JohnBolton, How do I export the max files in my own format? Im a beginer in 3d Max and the only way I know how to export the files is "click files->export"...

matthughson, the screenshots from the problem are at http://www.inf.ufrgs.br/~lamachado/3ds/
the source I got from gametutorials (and "changed" by me) is at the other (.zip) link...
the render picture was done with the 3d Max rendering, the openGL picture is the exported one. (I did not expect the same quality in both images, but take a look at the table at the right and the television... and a lamp is missing...). About the texture that do not load, the program do not load if there is a missing file...
I could not load the 3ds file with notepad/wordpad, I dont know how to create an ascii version...

Share this post


Link to post
Share on other sites
One common problem with 3ds files is that they sometimes seem to give the texture a .bmp extension in the save file, even if it is a jpg/png/whatever. It might be worth loading the texture for the bottle and saving it with a .bmp extension and see if that cures your white material problem.

Hope that helps,

Steve

Share this post


Link to post
Share on other sites
I was having the same problems with models exported from 3ds MAX. The only solution I found was using 3rd party exported to do the conversion (I used Deep Exploration for it)

Share this post


Link to post
Share on other sites
thanks Mephs, but Im already doing that...

Deep Exploration?!? I have never heard of that... what is it? where can I get it? is it free?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!