Alexander,
I build and use OpenVRML 0.18.5 in my codebase. I am presently compiling for
Win32, Linux 32/64, and OSX 32/64. I will go into what I did on the OSG side
to get things to work, so I assume that you are able to successfully build
OpenVRML libraries on your platform. Non-Win32 platforms worked fine for the
most part.
For all platforms, the one thing that I needed to add was an entry in
src/osgPlugins/vrml/CMakeLists.txt for include support for boost. OSG doesn't
have a universal boost configuration option (there is a Collada boost config),
which is why I haven't submitted a formal fix for this. Just add in a:
INCLUDE_DIRECTORIES(path_to_your_boost_include)
and the rest should be taken care of (rpath and boost linking taken care of on
the OpenVRML lib side).
If you build under windows, then there is more that needs to happen. A few
fixes if you are using Visual Studio 2010 since the TR1 naming conflicts with
boost (lines 113,117,122 of ReaderWriterVRML2.cpp are the source of the prob).
I will pass along a fix to Robert for that file. This is the same problem you
would have when building the VRML lib anyway so it should be familiar...).
VS2008 builds fine though. NOTE - I build boost and OpenVRML as DLLs, so the
following instructions are for that configuration. WIN32 CMakeLists.txt
changes I made amounted to replacing the IF(WIN32) clause with this:
IF (WIN32)
SET(TARGET_EXTERNAL_LIBRARIES Ws2_32.lib)
add_definitions("-DBOOST_ALL_NO_LIB -DOPENVRML_USE_DLL")
ENDIF(WIN32)
SET(TARGET_LIBRARIES_VARS
OPENVRML_LIBRARY)
Hope that helps.
Chuck Seberino
On Oct 11, 2010, at 6:20 PM, Jean-Sébastien Guay wrote:
> Hello Alexander,
>
> First of all, don't worry about your English so much it is very good and much
> better than my German! :-)
>
> Second, I would like to request that in the future, you ask any OSG-related
> questions directly on the osg-users mailing list or on the forum at
> forum.openscenegraph.org. That way, others can also reply and other people
> who have the same problems/questions as you will benefit from the replies.
>
> So, on to your questions. You've got the first steps right, though for the
> basic dependencies of OSG (libpng, zlib, libjpeg, freetype etc.) you could
> have downloaded the appropriate 3rdparty package from openscenegraph.org and
> saved a bit of time (I assume you downloaded these libraries yourself
> individually, though you don't mention that specifically).
>
>> Now i use this code to load a wrl-File: osg::ref_ptr<osg::Node> node =
>> osgDB::readNodeFile("sample.wrl");
>> This file from the tutorial is properly loaded, but if i replace the
>> filename i.e. with Anchor.wrl (a file from the openVRML examples) no scene
>> is displayed.
>
> I don't know these files specifically, but I think if you increase the OSG
> verbosity level it should tell you if there was any error while loading the
> file you asked it to load. To increase the verbosity, you can do on the
> command prompt:
>
> set OSG_NOTIFY_LEVEL=DEBUG
>
> or in your program's code, at the beginning of the main(), you could do:
>
> osg::setNotifyLevel(osg::DEBUG_FP);
>
> This will print lots of information about where OSG finds plugins, which
> OpenGL extensions are available, etc. and in all that information there
> should hopefully be a few messages from the OpenVRML loader telling you why
> the file couldn't load properly.
>
> It's possible the file contains some VRML that is not read/interpreted by the
> OSG VRML loader. I think the VRML loader only uses a subset of VRML and
> ignores the rest. Others will know more about this, I haven't done much with
> the VRML loader except compile it...
>
>> And should i use a newer version of openVRML? Then how should i set up my
>> system properly. (i already tried to compile the newest Version of OpenVRML
>> without success).
>
> I think the OSG VRML loader cannot work with newer versions of OpenVRML at
> all, though again others will be able to give you more details. If this is a
> problem for you then you may want to get familiar with the OSG VRML loader's
> code and try to improve it yourself, contributing your changes back to OSG
> afterwards!
>
>> My final task is to load wrl-Files and check if the wrl-file-standard is
>> correct. After that the Scene is used in OSG by other people.
>
> You may have to work a bit on the VRML loader if that's your goal, since as I
> said I think it only loads a subset of VRML at present.
>
> Hope this helps,
>
> J-S
>
>
> On 10/11/2010 6:11 AM, Alexander Moeller wrote:
>> Hi!
>>
>> My Name ist Alexander Moeller and i am from Germany (so please forgive
>> my bad english). And i'm new to OSG. I programmed with C++ before, but
>> not with such big librarys i have to compile by myself. I have same
>> questions about OpenSceneGraph espacially reading .wrl Files. It will be
>> nice if you can help me to solve these problems.
>>
>> I'm using Windows XP with Visual Studio Express 2008
>> Here are the steps i've done so far:
>>
>> -Downloading the source of OSG 2.8.3
>> -Build the solution without any errors
>> -Downloading OpenVRML 0.14.3 an installing it by following the
>> instruction of this tutorial
>> http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio/VisualStudioPlugins
>>
>> -CMake tells some errors of not finding pnglib, jpeg, zlib
>> -Donwloading this missing librarys, installing them and telling CMake
>> the correct Pathes.
>> -Building the solution of OSG without errors.
>>
>> Now i use this code to load a wrl-File: osg::ref_ptr<osg::Node> node =
>> osgDB::readNodeFile("sample.wrl");
>> This file from the tutorial is properly loaded, but if i replace the
>> filename i.e. with Anchor.wrl (a file from the openVRML examples) no
>> scene is displayed.
>>
>> So where is my mistake?
>> And should i use a newer version of openVRML? Then how should i set up
>> my system properly. (i already tried to compile the newest Version of
>> OpenVRML without success).
>>
>> My final task is to load wrl-Files and check if the wrl-file-standard is
>> correct. After that the Scene is used in OSG by other people.
>>
>> With regards
>> Alexander Moeller
>>
>> PS: You can correct this text if you like. So my english will improve. :)
>> ______________________________________
>> Lebe...und werde stärker! (Methos)
>>
>
>
> --
> ______________________________________________________
> Jean-Sebastien Guay [email protected]
> http://www.cm-labs.com/
> http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org