Beginner: Blender models in OpenGL apps

Started by
4 comments, last by mikenovemberoscar 12 years, 3 months ago
I realize that this has been asked about before, as I spent a long time searching google, as well as the forum for an answer, but all of the ones I found relied on amounts of knowledge that exceed mine. Therefore I make a thread of my own.

I have created a model in blender and I wish to use it in my OpenGL application. Can someone please explain to me how I would do this, and keep in mind that I am a beginner? I would be grateful.
Advertisement

I realize that this has been asked about before, as I spent a long time searching google, as well as the forum for an answer, but all of the ones I found relied on amounts of knowledge that exceed mine. Therefore I make a thread of my own.

I have created a model in blender and I wish to use it in my OpenGL application. Can someone please explain to me how I would do this, and keep in mind that I am a beginner? I would be grateful.


Save it to disk in a format of your choice, then load and parse the file in your application.
Most commonly used formats are well documented and many even have libraries you can download that will handle the loading and parsing for you.

Thats about as much help as you can get unless you specify what format you want to use.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

[quote name='Burnskagen' timestamp='1325453868' post='4898775']
I realize that this has been asked about before, as I spent a long time searching google, as well as the forum for an answer, but all of the ones I found relied on amounts of knowledge that exceed mine. Therefore I make a thread of my own.

I have created a model in blender and I wish to use it in my OpenGL application. Can someone please explain to me how I would do this, and keep in mind that I am a beginner? I would be grateful.


Save it to disk in a format of your choice, then load and parse the file in your application.
Most commonly used formats are well documented and many even have libraries you can download that will handle the loading and parsing for you.

Thats about as much help as you can get unless you specify what format you want to use.
[/quote]

I don't know, which format would be smartest? I don't need the lighting or the camera, but I want to store everything else, so that the objects can become part of a scene composed within the openGL app.
"Wavefront OBJ" if you want only meshes with materials (which loader is easy to implement).
"3D Studio Mesh" which has a limit of triangles per mesh - 65536 (16-bit). It contains a binary data which impossible to read in text editors (with "wavefront obj" you can). Data stored into chunks (meshes, materials, lights, cameras, animation (which "wavefront obj" doesn't contain)). If you need there only some kind of them just skip the chunks which you wouldn't use during reading from file.
There are many others (also you can create your own format (how to store data in file & how to get it from there)).
Need examples, tutorials? Ask Google for that (with list of formats supported by blender!) and chose the file format of scene which its architecture you like.
I recommend using the assimp (http://assimp.sourceforge.net/) library for loading models, it can load models for you in a variety of formats including blender format (although i don't recommend loading them directly). A good format to use would be MD3 or MD5 both of which assimp can load.
1. Learn how to read/write into text files with fstream.
2. Look at the OBJ File format.
3. Learn about fstream, and how to 'parse' with << and >>.

This is honestly a really easy task, I was once in your position and I was helped, so if you have any questions please ask. It is possible!

This topic is closed to new replies.

Advertisement