/ Visual Studio Plugins

OpenSceneGraph

Windows

Visual Studio Plugins

Visual Studio Plugins

 

back to Visual Studio

VRML plugin

The VRML plugin uses OpenVRML. Under Windows, it can only be compiled using version 0.14.3 of OpenVRML, because later versions depend on boost and had incompatible code changes. Note also that these instructions were tested with Visual C++ Express 2005, and some parts may differ if you are using a different version.

Download this package. Note that it contains precompiled libraries, but we cannot use those and must recompile them.

Open

...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\OpenVRML.sln

The OSG VRML plugin does not need OpenVRML's openvrml-gl library, nor the lookat application. Just delete those projects from the solution.

Then, select Debug mode, and change the Librarian - General - Output File property of each one of the 3 projects to add a 'd' at the end of the name, before the period. So openvrml.lib becomes openvrmld.lib and so on. Release mode will not be changed. That way, the debug and release libs can coexist in the same directory.

Pressing F7, apart from loads of warnings, you will get some errors:

Token.hpp line 76: replace this line

inline operator<(RefToken l,RefToken r); //{return true;}

with this

inline bool operator<(RefToken l,RefToken r); //{return true;}

AST.hpp line 151: same thing - replace this line

inline operator<(RefAST l,RefAST r); // {return true;}

with this

inline bool operator<(RefAST l,RefAST r); // {return true;}

And finally, in regerror.c, we have an old-style C function definition:

size_t
regerror(errcode, preg, errbuf, errbuf_size)
int errcode;
const regex_t *preg;
char *errbuf;
size_t errbuf_size;
{

replace it with

size_t
regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)\\
{

And then all should compile correctly (though with quite a few warnings). Change to Release mode and press F7 again to compile the libs in release mode.

Once that's done, create a directory under the main OpenVRML directory (for example, ...\OpenVRML\home-built ), copy the ...\OpenVRML\include directory into it, and copy the three libraries you just compiled into a lib subdirectory (...\OpenVRML\home-built\lib for example):

...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\antlr\Release\antlr.lib
...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\openvrml\Release\openvrml.lib
...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\regex\Release\regex.lib
...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\antlr\Debug\antlrd.lib
...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\openvrml\Debug\openvrmld.lib
...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\regex\Debug\regexd.lib]

Then, the OSG part. Rerun CMakeSetup with the top-level CMakeLists.txt, specifying the ...\OpenVRML\home-built\include directory in OPENVRML_INCLUDE_DIR and ...\OpenVRML\home-built\lib\openvrml.lib library in OPENVRML_LIBRARY. Configure, then Generate as usual.

Finally, build using the newly generated solution and project files. All should go well in both Release and Debug modes (though again, many warnings will be issued, courtesy of OpenVRML's header files).

Note: 2007/07/06 - The CMake files have not yet been updated to link to the debug OpenVRML libs when compiling OSG in debug mode. For now, in the debug configuration, manually change the lib names in "Plugins vrml" project Properties - Linker - Input - Additional Dependencies (replace antlr.lib with antlrd.lib, regex.lib with regexd.lib and openvrml.lib with openvrmld.lib). This should be fixed shortly.

Note: the VRML plugin only supports geometry with geometry nodes, so for instance Box or Sphere nodes will not display anything. You can use this file to test that it works. If you see a plane, a sphere, a pyramid, a rectangular prism, a cone and a teapot, it works.

QuickTime plugin

Download the QuickTime SDK from this page. Install it wherever you want, and then in !CMakeSetup specify the [...\QuickTime SDK\CIncludes] directory in QUICKTIME_INCLUDE_DIR, and ...\QuickTime SDK\Libraries\QTMLClient.lib in QUICKTIME_LIBRARY. Configure, Generate and build.

wxWidgets (for osgviewerwx)

Download this installer or the zip version. Install or unzip wherever you want. Open ...\wxWidgets-2.8.4\build\msw\wx.dsw, converting the project files when asked. Press F7 to build.

In CMakeSetup, specify the ...\wxWidgets-2.8.4\ directory in wxWidgets_ROOT_DIR...\wxWidgets-2.8.4\lib\vc_lib in wxWidgets_LIB_DIR and set wxWidgets_CONFIGURATION as "msw" and wxWidgets_USE_REL_AND_DEBUG to "ON". Configure, Generate and build.

Collada plugin

The Collada plugin is very easy to build now. Please see the Collada plugin page for instructions.

TODO: Instructions for other plugins go here

Attachments