Click here to Skip to main content
14,981,532 members
Articles / Multimedia / OpenGL
Posted 9 Nov 2007


25 bookmarked

OpenSG, WxWidgets and OpenGL - A Simple 3D File Converter

Rate me:
Please Sign up or sign in to vote.
3.18/5 (7 votes)
9 Nov 2007CPOL2 min read
Simple 3D Converter tool
Screenshot - Dolphins.jpg


A friend asked me once about a way to convert 3D files such 3D Studio 3Ds, VLMR, OBJ and so on with one engine able to work in almost all platforms. Well, lots of Googling around, came to me OpenSG - Open source portable scenegraph system to create realtime graphics programs (this comes from their website...). To simplify things, OpenSG is a huge library, and you can make things like work with threads natively, open almost every kind of 3D file, modify and save.

Screenshot - Saving.jpg

Using the Code

There is not much to do to build this project, except for about 40MB in library downloads (don't worry, my bet is: you will use it more than this time...).

You will need WxWidgets and OpenSG to build the sample.

Screenshot - wxwin32x32.png


The main download page is at Choose the wxMSW port, download and run. Follow the install instructions. My install path is "C:\library\cpp\wxWidgets-2.8.6", and if you'd like to use the same idea, you will not have to change any path in the project include/library options.

Before you start building, go to "include\wx\msw\setup.h", in line 994, you will find this define:

#define wxUSE_GLCANVAS 0

Change the value to 1. The result should look like this:

#define wxUSE_GLCANVAS 1

This is necessary to enable the use of OpenGL library in the WxWidgets frames.

Save the file and build wxWidgets (The default project compiles with just some warnings about deprecated functions. Here it takes about 3 minutes to build).

Screenshot - logo.gif


The main download page is at You will find a very strange table in there. Ok, no problem. Just look for the Dists column. There you can see the Win32/Visual Studio build (cl.net200X), with the binary download. It is a single 30MB file download. Download and install it. Again, my install path is "C:\library\cpp\OpenSG", but using it is up to you. A little change in the project options (include/library) can just allow you to use any path you like.

I tried to use the 2.0 version of OpenSG (from svn). No VC project (if you try to build the 1.8 from source, you will be successfull with not many efforts), a lot of changes in library classes. The result is: I can't build it. I really don't like scons, and retrieve a good VC project from his config files? Oh joy... I give up and just download the binary build.


  • 9th November, 2007: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Switzerland Switzerland
I'm a Graduated Computer Scientist in the University of São Paulo - Brazil, have a Master Degree in Network Security from Federal University of Santa Catarina. I'm working with computers from the beginning of the x86 series (286), since my Dad buy the first machine to his refloresting company, something about calculate variables to have the best nutrient percentage in a whatever size(that is an example of what kind of variable we need to input) square. In the start I find the use of that new toy very boring (if i like to play with the machine, i have to do the work too), and start looking how to do anything more stupid (ops, i mean, fun). The green still flash in my eyes when i blink. Smile | :)
Best regards to you all. Keep studing

Comments and Discussions

GeneralOpenSG and WPF Pin
njss27-Mar-09 6:53
Membernjss27-Mar-09 6:53 
GeneralRe: OpenSG and WPF Pin
Ccello27-Mar-09 8:02
MemberCcello27-Mar-09 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.