diff --git a/src/osgUtil/CubeMapGenerator.cpp b/src/osgUtil/CubeMapGenerator.cpp index 5839eccf1..84e748dcf 100644 --- a/src/osgUtil/CubeMapGenerator.cpp +++ b/src/osgUtil/CubeMapGenerator.cpp @@ -13,6 +13,8 @@ #include #include +#include + using namespace osgUtil; CubeMapGenerator::CubeMapGenerator(int texture_size) @@ -41,29 +43,28 @@ CubeMapGenerator::CubeMapGenerator(const CubeMapGenerator ©, const osg::Copy void CubeMapGenerator::generateMap(bool use_osg_system) { - const float duv = 2.0f/(texture_size_-1); + osg::Matrix M; + + if (use_osg_system) { + M = osg::Matrix::rotate(osg::PI_2, osg::Vec3(1, 0, 0)); + } else { + M = osg::Matrix::identity(); + } + + const float dst = 2.0f/(texture_size_-1); - float v = 1; + float t = -1; for (int i=0; i