OpenSceneGraph/src/osgPlugins/vrml/CMakeLists.txt
Robert Osfield af22bd70db From Johan Nouvel, "Some times ago, I have coded an osg to vrml2 writer. Today, I have updated our writer to osg 2.9.9.
As it works (for our needs at least) I've done and attached a tar.gz file for the VRML2 plugin with a new part to write a VRML2 file from an osg one.

The read part is the same as in osg 2.9.9.

The write part code is in convertToVRML.cpp and .h  files. It works for some osg nodes (group, geode, matrixTransform, positionAttitudeTransform and geometry). Textures are converted to jpeg (if not translucent) or png (if translucent).
There are some options that could be given to the writer (with -O switch) :

convertTextures=0   to copy textures without converting them to jpeg or png
convertTextures=-1  do not copy textures, keep them in their original format and location
convertTextures=-2  do not use textures, parse only geometry
convertTextures=-3 (default) convert textures to jpeg or png ones.

textureUnit=X  in case of multiple textures, X= texture unit to use (default value=0)

directoryTexture=aPath  when texture will be copied, it will be in this directory, not in the current one."
2010-11-08 15:49:30 +00:00

50 lines
1.2 KiB
CMake

INCLUDE_DIRECTORIES(${OPENVRML_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${OPENVRML_INCLUDE_DIR}/openvrml)
IF (WIN32)
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
FIND_LIBRARY(OPENVRML_ANTLR_LIBRARY
NAMES antlr.lib
PATHS $ENV{OPENVRML_DIR}/lib)
FIND_LIBRARY(OPENVRML_ANTLR_LIBRARY_DEBUG
NAMES antlrd.lib
PATHS $ENV{OPENVRML_DIR}/lib)
FIND_LIBRARY(OPENVRML_REGEX_LIBRARY
NAMES regex.lib
PATHS $ENV{OPENVRML_DIR}/lib)
FIND_LIBRARY(OPENVRML_REGEX_LIBRARY_DEBUG
NAMES regexd.lib
PATHS $ENV{OPENVRML_DIR}/lib)
SET(TARGET_LIBRARIES_VARS
OPENVRML_ANTLR_LIBRARY
OPENVRML_REGEX_LIBRARY
OPENVRML_LIBRARY
JPEG_LIBRARY
PNG_LIBRARY
ZLIB_LIBRARY)
SET(TARGET_EXTERNAL_LIBRARIES
Ws2_32.lib)
ELSE()
SET(TARGET_LIBRARIES_VARS
OPENVRML_LIBRARY)
ENDIF()
SET(TARGET_SRC
IndexedFaceSet.cpp
Primitives.cpp
ReaderWriterVRML2.cpp
ConvertToVRML.cpp
)
SET(TARGET_H
ReaderWriterVRML2.h
ConvertToVRML.h
)
#### end var setup ###
SETUP_PLUGIN(vrml vrml)