Public Group

This topic is 4416 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I think I have enough knowledge of opengl(on win32 platform) to write a very basic pong game and I wanted to be able to load my models.I've searched the web for many many hours and have come up with not much. What I am asking , please, is there anyone who can point me to a good .obj loader? my meshs are simple (I customized the paddles). Thank you who respond in advance.

##### Share on other sites
OBJ file format:

http://www.royriggs.com/obj.html

##### Share on other sites
If it's a simple pong game, do you really need models?

Anyway, I've been looking a bit, and can't really find anything good, so you should find the obj file specifications (just google it) and you should be able to find the documents on the way the obj format is laid out.

I haven't tried it myself, but I've heard that it's not particularly complicated, and if you're doing graphics, you should have had experience with file IO, so you should start writing a loader and then come to us with your questions.

Assuming you're talking about the text format and not the binary, here's something that might get you started: Fileformat.info: Wavefront OBJ

##### Share on other sites
true Endar but it would be better in the long run. Thanks, I'll go through and check it out. Just in general, doesn't it seem wierd that there is no easy load library for objects in opengl or at least some agreed apon format like direct3d has .x format. Hmm oh well and thanks :)

[Edited by - Asem on June 11, 2006 10:45:25 AM]

##### Share on other sites
GLM is a pretty good and stable library(from my experience). You're right that it's not easy to find OBJ loaders in the web, it took me almost an hour of googling to track it down.

You can build it as a .lib, but I usually just add all the files in the "/glm-0.3/glm" folder in my project, specify "/glm-0.3/glm" as an additional include directory and that's it. In case you need a quick start, an example:

//Loading the modelGLMModel* model;model=glmReadOBJ("c:/models/airplane.obj");glmVertexNormals(model,180.0,false);//Optional-recalculates and smooths the normals//Drawing the modelglPushMatrix();//transformations here...glmDraw(model,GLM_SMOOTH|GLM_TEXTURE|GLM_MATERIAL);glPopMatrix();

Beware: You need to use "/" and not "\\" when specifying the path for the .obj files. GLM only understands it this way.

Also, you can go and download 3DWin, which is a converter for many 3d formats, including Wavefront OBJ. So you can take a,say, .3ds file, convert it to .obj and load it using GLM.

##### Share on other sites
Is there anything like GLM but for windows? I need to load obj models using openGL and I can not find something quick and easy on the web. Any help?

Thanks!

Edgar

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 29
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002290
×