This topic is now archived and is closed to further replies.


Load a file for OpenGL

Recommended Posts

I''m not sure what you mean with "What''s Milkshape", so I''ll try to answer the question in both ways.

Milkshape (3D) is a 3D modelling programme which is very popular because it''s almost free (only 20$ to register after the trial period) and it''s very easy to use, but still good (although it does not have as many options as the bigger 3D modelling programmes)

If you meant, how do I load the Milkshape files, there''s a tutorial covering that topic on NeHe. You can find it here.

The tutorial is C++ though... The code is also converted to some other languages so just check if it helps you... maybe there''s also a Delphi version...

Hope that helps, but I doubt it

As for the other question, I don''t think the differences between loading the different model formats are really big... I advise you to make code for the model format you like best...

''Qui habet aures audiendi audiat'' - Me

A link to the website of my 3D engine will follow as soon as I have something concrete to show... Which will be soon.

Share this post

Link to post
Share on other sites
The easiest to load, technically, is raw triangle. This does not give much functionality though, as it only loads vertex data (no texture coordinates or color data). This can be fixed by making a modified version of the raw format. But here''s how the raw format looks.
1.0 3.0 2.0 3.0 4.0 6.0 1.4 7.4 2.0
1.2 4.2 5.7 2.4 6.8 4.3 2.4 1.1 2.3

You will notice that each line has nine numbers, or three sets of three. Each three numbers is a vertex, so each line is a triangle. Super simple to load. Just use ifstream to load them in, and atof to convert from char[] to float. Then you have a basic model loaded, simple as that. Hope this is helpful in at least some way. My first loaded models were raw, as it was easiest to learn. Then came binary version of raw, then my own format containing extended data. Best of luck to you.

Alex Broadwin
A-Tronic Software & Design
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post

Link to post
Share on other sites