3d models (maya)
i need some help now with loading 3d models in opengl. i can't find very much info on the web. i would mostly like to use maya, but if you know of another language that would be good, say so. i went to nehe's tutorial on importing milkshape models, but i still don't get it. i need something a little more clear, does anybody know of any tutorials or books that would be helpfull?
try loading wavefront files. They are textbased and easy to parse. most 3d package will be able to export to .obj. As for tutorials... google is you friend.
ok, i still have a little problem. i just don't know how to load models, i can export them and everything. i don't know how to import them into my c++ project. i searched on google for a long time, and i just can't find any good tutorials, actaully, i can't find any at all on how to get them into my project. do you know of a good tutorial or book or something?
For a tutorial on loading Obj files, I *think* there is one here at UltimateGameProgramming. You will have to go to Tutorials->OpenGL then look though the pages. Note that you will need a flash enabled browser to use that site (which I don't). See if one is there, if not I may have another site that you can find stuff.
thaaaaank you, this site is awsome, and it does have one, but what it the other site you were talking about?
crap, it doesn't really explain anything though, do you know of another site that might help?
crap, it doesn't really explain anything though, do you know of another site that might help?
Delphi is a programming language. Take a look at this for more. For that other OBJ file loader, I will send you a PM if I can find it [wink].
The format is realy simple. it goes like this:
a vertex is a line that starts with the letter v followed by 3 floating point numbers. i.e
v 3.01213 -1.2345 1.000
a vertex normal starts with vn followed by 3 floatig point numbers
vn 1.000 2.345 3.1415
a texture coordinat starts with vt followed by 2 numbers
vt 0.123 0.567
a triangle looks like this
f 1/1/1 10/3/5 15/4/6
meaning that
- the 1st point of the triangle uses the first vertex, the first normal and the first texture coordinate in the file
- the 2nd point uses the 10th vertex, 3rd normal and 5th texture coordinate
- the 3rd point uses the 15th vertex, 4th normal and 6th texture coordinate
you can ignore the rest of the lines (if any).
(there is a bit more but this will do for a start.)
now you have to do 2 passes on the file. in the first pass you count the number of vertex, normals texture coordinates, then you allocate memory to hold the date and in the second pass you you read in the data.
a vertex is a line that starts with the letter v followed by 3 floating point numbers. i.e
v 3.01213 -1.2345 1.000
a vertex normal starts with vn followed by 3 floatig point numbers
vn 1.000 2.345 3.1415
a texture coordinat starts with vt followed by 2 numbers
vt 0.123 0.567
a triangle looks like this
f 1/1/1 10/3/5 15/4/6
meaning that
- the 1st point of the triangle uses the first vertex, the first normal and the first texture coordinate in the file
- the 2nd point uses the 10th vertex, 3rd normal and 5th texture coordinate
- the 3rd point uses the 15th vertex, 4th normal and 6th texture coordinate
you can ignore the rest of the lines (if any).
(there is a bit more but this will do for a start.)
now you have to do 2 passes on the file. in the first pass you count the number of vertex, normals texture coordinates, then you allocate memory to hold the date and in the second pass you you read in the data.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement