View Full Version : how to load wavefront objects
01-25-2009, 04:11 PM
i'm a beginner and i'm trying to load a wavefront object into my program
i have the ASCII code of the .obj...
can someone help me and explain me how can i load it?
01-25-2009, 06:09 PM
i'm a beginner and i'm trying to load a wavefront object into my program i have the ASCII code of the .obj...
can someone help me and explain me how can i load it? What does your 'program' do so far?
01-26-2009, 01:04 AM
mmm.. the question in not strictly openGL related but here
you can find all the code/documentation you need. :)
01-26-2009, 03:44 AM
What does your 'program' do so far?
it is supposed to be a game
a cannon trying to shoot bunnies.
i've done the cannon,the environment and the cannon shots
and i've been given the ASCII code of the bunny,but i don't know how to load it in my program...
01-26-2009, 03:48 AM
you need to parse the *.obj file and read out the vertices, normals, texture coordinates and so on. when you done reading them out you treat this data as you contruct your canon, f.e. upload to video memory or store them in a way appropriate for rendering.
the parsing isn't that difficult but that depends how familiar you are with the file format and how good your are at your programming language.
If you are using C++ you can take a look at this code: http://www.artifactgames.de/Code/Loader.zip
It will parse an OBJ and load the data into an internal struct. From there on you can easily integrate it into your own structures. Feel free to use / modify, as you wish.
01-26-2009, 04:15 AM
thank's for your help!
i think i can make it now!!
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.