[译]OpenSG,WxWidgets和OpenGL-一个简单的3D文件转换器
By robot-v1.0
本文链接 https://www.kyfws.com/applications/opensg-wxwidgets-and-opengl-a-simple-3d-file-conve-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 4 分钟阅读 - 1737 个词 阅读量 0[译]OpenSG,WxWidgets和OpenGL-一个简单的3D文件转换器
原文地址:https://www.codeproject.com/Articles/21255/OpenSG-WxWidgets-and-OpenGL-A-Simple-3D-File-Conve
原文作者:Ccello
译文由本站 robot-v1.0 翻译
前言
Simple 3D Converter tool
简单的3D转换器工具
介绍(Introduction)
一位朋友曾经问我关于一种3D Studio 3D,VLMR,OBJ等3D文件的转换方法,并且该引擎可以在几乎所有平台上运行.好吧,很多Google搜寻都来找我,OpenSG-开源的可移植场景图系统,用于创建实时图形程序(来自他们的网站…).为简化起见,OpenSG是一个庞大的库,您可以进行诸如本机处理线程,打开几乎每种3D文件,进行修改和保存之类的事情.(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.)
使用代码(Using the Code)
除了可以下载40MB的图书馆资源外,构建这个项目没有什么可做的了(别担心,我敢打赌:您将比这次更多地使用它…).(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…).)
您将需要WxWidgets和OpenSG来构建示例.(You will need WxWidgets and OpenSG to build the sample.)
WxWidgets(WxWidgets)
主要下载页面位于(The main download page is at) http://www.wxwidgets.org/downloads/(http://www.wxwidgets.org/downloads/) .选择wxMSW端口,下载并运行.请遵循安装说明.我的安装路径是"(. Choose the wxMSW port, download and run. Follow the install instructions. My install path is “)C:\ library \ cpp \ wxWidgets-2.8.6(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 “)包括\ wx \ msw \ setup.h(include\wx\msw\setup.h)",在994行中,您将找到以下定义:(”, 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
这是启用WxWidgets框架中的OpenGL库所必需的.(This is necessary to enable the use of OpenGL library in the WxWidgets frames.)
保存文件并构建wxWidgets(默认项目仅带有有关不推荐使用的功能的警告,在编译时需要3分钟.)(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).)
OpenSG(OpenSG)
主要下载页面位于(The main download page is at) http://www.opensg.org/dailybuild_logs/index.EN.html(http://www.opensg.org/dailybuild_logs/index.EN.html) .您将在其中找到一张非常奇怪的桌子.好,没问题只需查找" Dist"列.在那里,您可以看到Win32/Visual Studio版本((. 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(cl.net200X)),以及二进制下载.这是一个30MB的文件下载.下载并安装.同样,我的安装路径是"(), with the binary download. It is a single 30MB file download. Download and install it. Again, my install path is “)C:\ library \ cpp \ OpenSG(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.)
我尝试使用OpenSG的2.0版本(来自svn).没有VC项目(如果尝试从源代码构建1.8,您将花费很多精力就可以成功),库类中有很多更改.结果是:我无法构建它.我真的不喜欢scons,并从他的配置文件中检索一个好的VC项目吗?噢,喜悦…我放弃了,只是下载二进制版本.(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.)
历史(History)
- 9(9)日(th)2007年11月:初始职位(November, 2007: Initial post)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ VC8.0 WinXP Win2003 Win2K Visual-Studio OpenGL VS2005 Design Dev 新闻 翻译