Jump to content
  • Advertisement
Sign in to follow this  
ArchG

OpenGL Loading 3DS Models, or OBJ Models in C#

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

Hello, I've just started learning OpenGL using C# and the Tao.OpenGL framework. Just wondering if anyone has wrote some code to load up some models in either .obj files or .3ds files? Through my extensive research 10 minutes of [google] searching I couldn't seem to find anyone who has done this in c#... I saw the threads posted in the FAQ of this forum, but they were all for C/Cpp...I would rather not write my own loader if I don't have to. Also let me know if this question would be a better post for the .NET forum. Thanks, ArchG

Share this post


Link to post
Share on other sites
Advertisement
i have a fairly decent model loader written in c++ for the .3ds file format. i used spacesimulator.net as a reference and it turned out pretty well. if you would like to see it i can post it here, or send you a copy.

ps: anyone know how i can get in touch with the guy in charge of spacesimulator.net?

Share this post


Link to post
Share on other sites
Is there any reason you don't want to use .X? Then you can just use standard D3DX functions to load your models.

Share this post


Link to post
Share on other sites
Quote:
Original post by yaroslavd
Is there any reason you don't want to use .X? Then you can just use standard D3DX functions to load your models.


*points out we are in OpenGL land so no D3DX* [grin]

Share this post


Link to post
Share on other sites
yeah, he is in c# so why not use directx? isn't that what c# was originally meant to use since they are both ms products?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi,

I know the problem and feeling. I am also working in OpenGl on C#.NET. I searched for ages to find a topic or opensource project that could load 3DS or OBJ files. Nobody could help me though, and everybody told me to move to C++ instead. So what I did was creating my own file system: I call it B3D.

I wrote a converter for *.X3D files. X3D is an plaintext fileformat. So it's relatively easy to understand. Loading 3DS files would have been better of course. But 3DS is a bit more complicated. X3D however is also pretty popular though. There are exporters for all popular 3D modeling software (3D Studio Max, Maya, Blender, ...) During development of this X3D to B3D converter I concentrated on Blender though (since that's the only good free program)

My converter works pretty good now. It makes part of a bigger project (A 3D Engine for an ant strategy game) You can follow the progress on http://antwars.blogspot.com

Like I told earlier ... 3DS is more complicated. I found a website with good discriptions though! http://www.xbdev.net/3dformats/3ds/3ds.php Try this website it explains everything in a 6-steps tutorial. I didn't read it completely, but it takes a lot of bit-operations it seems.

Hey, if you get this working I would really appreciate it if you let me something know. :) If you want you can also borrow my B3D DLL's it works pretty good, allthough I am still modifying some parts every day.

bvandenbon
(--AT--)
gmail
(--DOT--)
com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by supercat1
yeah, he is in c# so why not use directx? isn't that what c# was originally meant to use since they are both ms products?


Because ManagedDirectX is slower and because it is not available crossplatform. Also it is my personal believe that OpenGl is more open to the industry.

By the way, C# is not a microsoft product. Microsoft just happened to make the best IDE for it. In fact Microsoft did it so perfect that everybody thinks they have invented it, and that other operating systems are denying C#...
==> In fact Macintosh has denied C++ for a long time just the same way, because it was an "evil Microsoft invention". But C++ is no less or more a Microsoft invention than C# is.
==> And for Sun, they want to go through with Java at all costs of course. This while C# is made to be an improvement of Java in every way... and it really is.

Well I'm not a Microsoft lover, but having programmed on all 3 platforms and in several languages this is just an honest opinion. And of course this oppinion is only on programming not on operating systems.

Share this post


Link to post
Share on other sites
There are a couple of 3ds libraries and sample code around, mostly in c++. It is not hard porting them over to c# and implementing them in your engine if you really want to use 3ds files (I strongly suggest against them, the format is just way to old and unflexible, you will not be able to implement any new features that easily).

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
Original post by supercat1
yeah, he is in c# so why not use directx? isn't that what c# was originally meant to use since they are both ms products?


Because ManagedDirectX is slower and because it is not available crossplatform. Also it is my personal believe that OpenGl is more open to the industry.

By the way, C# is not a microsoft product. Microsoft just happened to make the best IDE for it. In fact Microsoft did it so perfect that everybody thinks they have invented it, and that other operating systems are denying C#...
==> In fact Macintosh has denied C++ for a long time just the same way, because it was an "evil Microsoft invention". But C++ is no less or more a Microsoft invention than C# is.
==> And for Sun, they want to go through with Java at all costs of course. This while C# is made to be an improvement of Java in every way... and it really is.

Well I'm not a Microsoft lover, but having programmed on all 3 platforms and in several languages this is just an honest opinion. And of course this oppinion is only on programming not on operating systems.

What have you been smoking?

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!