PDA

View Full Version : how to load model 3D into opengl program


rosma
02-10-2009, 10:09 PM
hye all.. please help me to teach me how to load model 3D into opengl program.. i feel excited to know about it.. to ANUDYAN, COULD U PLEASE HELP ME AND GIVE ME YOUR CODE LIKE YOU GIVE IT TO CHINGCHING? I'M APPRECIATE THAT..

Reedbeta
02-10-2009, 10:32 PM
Who are Anudyan and Chingching? There is no one by those names on this forum.

As for loading models, if it's in a standard format you'll need to find a loader on the internet (or write your own if the format specification is available). What format are your models in?

fireside
02-12-2009, 08:44 AM
The best place to start with loading models into opengl, and also the furthest I ever got with it, is loading wavefront object models. They end in .obj. Most modelers export in this format. If you open them with a text editor they are written in plain text and the format is pretty easy to figure out, specifying faces and vertices, etc. Doing a search in Google for some like "opengl obj loader" will probably find you some examples.

rosma
02-15-2009, 10:30 PM
ok thnks a lot fireside.. can u give me a sample code or project to load the model into opengl?? i really need ur help.. thnks

Sol_HSA
02-15-2009, 11:43 PM
I think you need to do some of the work yourself if you are to learn anything.
Alternatively, download irrlicht or ogre or some other freely available engine and use their model loading functions. You won't be using opengl directly that way, though.

fireside
02-15-2009, 11:56 PM
There's some c++ code for loading obj on this page:
http://www.robthebloke.org/opengl_programming.html#5

There's a 3ds loader here:
http://www.garagegames.com/community/resources/view/506

Like Sol HSA says, though, you'll learn more if you write your loader and obj is pretty easy to figure out if you open the file. NEHE also has a model loading tutorial but its for milkshape 3d. The first link is a tutorial for obj files so it's probably your best bet.

rosma
02-18-2009, 06:08 AM
There's some c++ code for loading obj on this page:
http://www.robthebloke.org/opengl_programming.html#5

There's a 3ds loader here:
http://www.garagegames.com/community/resources/view/506

Like Sol HSA says, though, you'll learn more if you write your loader and obj is pretty easy to figure out if you open the file. NEHE also has a model loading tutorial but its for milkshape 3d. The first link is a tutorial for obj files so it's probably your best bet.



ooo really.. thnks a lot.. well, may i ask u about AUGMENTED REALITY IN EDUCATION.. actually my final year project is about ARToolkit.. so may i know how to build my own program and combine with ARToolkit? can u help me? please i really2 need your help... thnks....

fireside
02-18-2009, 09:15 AM
I took a quick look. It's just c and opengl, so you should be able to load a model and display it like the tutorial for loading objects. You should be working through the tutorials for ArTool and probably ask your teacher for help if you can't understand it. ArtTool looks like it may have model loaders, are you sure it doesn't? If there is a forum for it, that's the first place you should go to ask questions, rather than a general forum like this one. Otherwise it uses Glut, so just find some Glut tutorials on opengl if you can't understand the tutorials from ArtTool. You should start by making triangles and quads and such before working on a model loader. NeHe has some opengl tutorials. From the looks of it, though, I would guess they already have a model loader set up.

rosma
02-22-2009, 08:08 PM
NeHe?? what is that?

Reedbeta
02-22-2009, 08:45 PM
As a two-second Google search would have told you, it's http://nehe.gamedev.net/

mmakrzem
02-26-2009, 02:37 PM
On my website you'll find instruction for creating a caligari COB file loader. I also show how to create your own file format. In the next little while I'll be posting code how to load FBX files too.

rosma
03-02-2009, 09:02 PM
orait.. thnks a lot because helping me.. ermm do u know about augmented reality in education? actually my final year project is about augmented reality.. and my lecturer(supervisor) said must use ARToolkit.. do u know about ARToolkit? i want to build my own program using ARToolkit.. could u please give me some guide for build my own program?.

fireside
03-03-2009, 11:59 AM
I don't know if you are having problems with Google, but I looked up the forum for you to ask questions:
http://www.hitlabnz.org/forum/forumdisplay.php?f=4

Go to the development and code sections. There are some questions about model loading there so read them and then ask for help if you don't understand.