Jump to content
  • Advertisement
Sign in to follow this  
SpacedOut

OpenGL .obj model

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm looking for a way to load .obj files into my OpenGL programs. I'd rather learn how to do it than just use an engine. Does anyone know of any examples or tutorials on loading .obj models in OpenGL?

Share this post


Link to post
Share on other sites
Advertisement
ohh, another thing.

can .obj files display textures colors that were put on them when they were created in a 3d modeler. If not, how do you put them on?

Share this post


Link to post
Share on other sites
Loading in an obj model is not terribly difficult but it can take quite a few lines to get the job done right. You should start by reading the entire spec (link).

Once you understand how an obj is formatted, you should think about how you are going to store the data structures and how you will traverse the structures in your rendering loop. Textures are supported and usually are identified by filename in a seperate .mtl file. The UV coordinates are in the .obj file.

Share this post


Link to post
Share on other sites
There is an example with source on page 8 of ultimategameprogramming.com's opengl tutorials.
I have not looked at the source myself, but it should probably be enough to get you started.

Regards,
ViLiO

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!