Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Best way to load a 3D object into memory from a file?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Prateek Malhotra   Crossbones+   -  Reputation: 215

Like
0Likes
Like

Posted 24 February 2013 - 08:43 AM

I recently wrote a small program in c# to load 3D models from files like '.obj'. It parses the data and loads it in memory using regex and casts the values to doubles..

Then the program dumps this memory data arrays into a binary file, which can be readily loaded into my DX10 application.

 

Can anyone tell me if this is the best way to load a 3D object? (because I read it somewhere a long time ago)

I have been reading lots of tutorials about directx and I am trying to develop a simple 3d engine (in C++). (I frankly got sick of doing the small tutorials about triangle rendering and stuff..)

 

Also please give me some pointers on how should I go about on arranging the data in the file so that I would be able to pick up material and texture info too.. I am only working with vertex data for now.

 

I happen to have about 5 long months of doing almost nothing, so I thought I may just as well try learn about game programming by actually trying it out instead of reading the tutorials about it...

 

Also can anyone give me a link on how to interpret the DirectX debug output?

 

Thanks...



Sponsor:

#2 BornToCode   Members   -  Reputation: 936

Like
2Likes
Like

Posted 24 February 2013 - 11:55 AM

The way you are doing it is not a bad way of doing things. One of the advantage the way you are doing it, is that you can load different formats and dump it to an format that your dx app can load. I do something very similar in my engine where i have an external tool that loads .fbx,.obj and .ase to an format that my engine loads.


Edited by BornToCode, 24 February 2013 - 11:56 AM.


#3 Prateek Malhotra   Crossbones+   -  Reputation: 215

Like
0Likes
Like

Posted 24 February 2013 - 01:46 PM

Well which tool do you use? The thing is I need all the stuff like vertex data, texture data, material data, animation data, etc in one format which i can then parse into my own format to load into my engine. From what I have read the .X format is the best at it, but it sounds very complicated with the bone hierarchies and stuff.

 

If the animation data is complicated in every format, then I guess I am stuck with leaning how to use it, however, if there is an easier way to access all these facilities in a particular format then I would like to stick with that format.

 

And if you could tell me about a good site for learning about directx debug output, that would be really nice.

 

Anyways thanks for your reply.



#4 BornToCode   Members   -  Reputation: 936

Like
2Likes
Like

Posted 24 February 2013 - 04:06 PM

The tool is my own custom tool. It extract all the information about the an Mesh such as Vertices/Normals/Tangents/Bones information and store into an .gameformat which is custom. One of the format i can consider to look into is the .fbx format. You can used Autodesk  fbx SDK to load .fbx models.

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=7478532


Edited by BornToCode, 24 February 2013 - 04:09 PM.


#5 beans222   Members   -  Reputation: 1135

Like
2Likes
Like

Posted 25 February 2013 - 01:33 AM

http://assimp.sf.net

Assimp supports importing a wide array of file formats.

Best way to use it is to import using assimp and export to your own format.


New C/C++ Build Tool 'Stir' (doesn't just generate Makefiles, it does the build): https://github.com/space222/stir

 


#6 Prateek Malhotra   Crossbones+   -  Reputation: 215

Like
0Likes
Like

Posted 25 February 2013 - 09:32 AM

Thanks I will try both the techniques..






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS