Blender is an open source 3D content creation suite.
Ogre 3D is a 3D library for multiple desktop and mobile platforms.
But is a problem between this tow way.
The last Blender 3D did not have yet a script to export the mesh to last Ogre 3D.
What we can do ?. It’s a simple way to make all working.
Use the old version of these two and you can also use old video cards.
After you make all settings of code::blocks to use all Ogre libraries, you need to use some tricks.
First, in your source code you need to tell about this:
1 | Root* mRoot = new Root("plugins.cfg","ogre.cfg","ogre.log"); |
This means all three files are using the 3D engine.
On Linux first file – plugins.cfg it is on my distro:
1 2 3 4 5 6 7 8 9 10 11 12 | # /etc/OGRE/plugins.cfg - ogre plugins installed on Debian systems # # Warning: this file is autogenerated but anything between this line and # the line saying "-*- ogre-plugins -*-" will be copied as-is on updates. PluginFolder=/usr/lib/OGRE # default plugins installed with the libogremain package. Plugin=RenderSystem_GL.so Plugin=Plugin_ParticleFX.so Plugin=Plugin_BSPSceneManager.so Plugin=Plugin_OctreeSceneManager.so # Don't edit anything starting from next line; it was autogenerated. # -*- ogre-plugins -*- [Please, don't remove or modify this marker] |
But is because I use a very old video card.
Let’s see the next file – ogre.cfg.
1 2 3 4 5 6 7 8 9 | Render System=OpenGL Rendering Subsystem [OpenGL Rendering Subsystem] Display Frequency=58 MHz FSAA=0 Full Screen=No RTT Preferred Mode=FBO VSync=No Video Mode= 600 x 400 sRGB Gamma Conversion=No |
As we see it’s an easy way to set some settings like 600 x 400.
The ogre.log it’s used to show the problems.
Let’s see another step in the source code:
1 | cf.load("resources.cfg"); |
This load the file – resources.cfg.
Let’s see this file:
1 2 3 4 5 | # Resource locations to be added to the 'boostrap' path # This also contains the minimum you need to use the Ogre example framework # Resource locations to be added to the default path [General] FileSystem=/home/YOUR-USER/ogre/YOUR-PROJECT/OGRE-FOLDER-MEDIA |
The YOUR-USER is your user home folder.
The YOUR-PROJECT it is the folder of project code::blocks.
The OGRE-FOLDER-MEDIA is a folder of all files is export by Blender 3D.
Let me show my simple example using NVIDIA FX video card.
The next image shows us one 3D object which is a mesh object.
After I make all materials and mesh with the same name.
I use the script to export ogre mesh using the 2.49a version.
The next two images show the settings I need to make to have a mesh.
Also, you keep just the object you need to export.
You can use the simple C++ source code to render with Ogre Engine.