PDA

View Full Version : Creating a loading function for ASE files



cmos
06-05-2001, 04:40 PM
I would consider myself large newbie to the 3d computer game field http://www.opengl.org/discussion_boards/ubb/smile.gif. With that in mind, my question has to do with creating a loader function for 3d files. I have never created a file format, or created a loadeder for one. I have been reading the threds in which many suggestions fly around, from building your own, to using sombody elses. I also have seen a website for the 3ds/ASE format, although, as a novice, I am unsure how to go about creating a loader, what do with the data, even for a simple format like ASE. This is not directly OGL releated, but I'm sure one of you on the forms could help me out http://www.opengl.org/discussion_boards/ubb/smile.gif. I would like to know where I could read up on creating file loaders, just generally, or more geared toward 3d graphic formats.

Thanks in advance!
(Of course, this could be the part I missed in my C++ classes http://www.opengl.org/discussion_boards/ubb/wink.gif)

[This message has been edited by cmos (edited 06-05-2001).]

Deiussum
06-07-2001, 05:15 AM
Creating a loader is no more complicated than using standard C/C++ file loading routines such as fstream objects or fopen/fread and parsing the data to get the info you need. In the case of 3d models that info includes vertex data at a minimum and usually other things such as normals, texcoords, and material info as well.

Usually you need to learn the layout of the format you are parsing in order to know exactly how to find where the data you want lies, and then extract it and put it into arrays so that you can use the data to display your model.

I haven't looked specifically at the ASE format myself yet, but from what I've heard it is pretty easy to figure out where things are just by looking at it. It is a pure text format so you can just open one up in something like Notepad to look at. For other formats, http://www.wotsit.org is a good place to check for specific file format information.

Tim Stirling
06-08-2001, 09:26 AM
I find I get loaders to 90% work but never fully and I can never debug them either. AS long as you are moderatly good programmer then making a loader for a lot of the simpler file formats is easy, if you try doing some impossible binary compressed thing then it aint http://www.opengl.org/discussion_boards/ubb/smile.gif.