I found that changing the alignment of a text object does not work properly if the text contains newline characters. I've attached a simple test case that shows the problem. If I set the text AFTER setting the alignment, everything works fine. But if I set the text BEFORE setting the alignment then the text is displayed incorrectly.
The fix is very simple. Instead of calling computePositions() in TextBase::setAlignment(), it calls computeGlyphRepresentation(). I've attached the modified TextBase.cpp."
f 15939/9999/16177 15941/10000/16178 15940/10001/16179\
15938/10002/16180
In the OBJ loader the newline would be interpreted as follows
f 15939/9999/16177 15941/10000/16178 15940/10001/1617915938/10002/16180
However, for correctly loading the model it should be interpreted as
f 15939/9999/16177 15941/10000/16178 15940/10001/16179 15938/10002/16180
Thus, the escaped newline should be interpreted as a space.
I tried to lookup what the correct interpretation for a backslash-newline was in the OBJ spec but did not find anything useful. Nevertheless, my suggestion would be to adopt replacing the escaped newline by a space in order to avoid problems as stated above. I cannot imagine a meaningful usage of a newline within a numerical literal so I do not foresee cases where replacing a backslash-newline by a space would be harmful. The fixed obj.cpp is zipped and attached to this mail."
Enclosed is include/osgParticle/Particle. I removed the const from the
return type of getSTexCoord. I also changed the name on the next
function to getTTexCoord so it is consistent with getSTexCoord. If you
prefer to change getSTexCoord to getSCoord you will need to change it in
ConnectedParticleSystem.cpp."
- osg::Texture sets GL_MAX_TEXTURE_LEVEL if image uses fewer mipmaps than
number from computeNumberOfMipmaps (and it works!)
- DDS fix to read only available mipmaps
- DDS fixes to read / save 3D textures with mipmaps ( packing == 1 is
required)
- Few cosmetic DDS modifications and comments to make code cleaner (I hope)
Added _isTextureMaxLevelSupported variable to texture extensions. It
could be removed if OSG requires OpenGL version 1.2 by default.
Added simple ComputeImageSizeInBytes function in DDSReaderWrites. In
my opinion it would be better if similar static method was defined for
Image. Then it could be used not only in DDS but other modules as well (I
noticed that Texture/Texture2D do similar computations).
Also attached is an example test.osg model with DDS without last mipmaps to
demonstrate the problem. When loaded into Viewer with current code and moved
far away, so that cube occupies 4 pixels, cube becomes red due to the issue
I described in earlier post. When you patch DDS reader writer with attched
code but no osg::Texture yet, cube becomes blank (at least on my
Windows/NVidia) When you also merge osg::Texture patch cube will look right
and mipmaps will be correct."
"The dragger's corner tabs are no longer in the corners."
this fix places the cornertabs back in the corners.
(the manipulator does not make sense otherwise)."
platform:
1 - osgAnimation/StatsHandler includes <cmath>, but on Cygwin only std::isnan
is defined that way. I changed it to <math.h> as it is done in the rest of
the OSG.
2 - Pulling some osgViewer headers from the same file in osgAnimation makes
the former a new dependency. Thus, I got errors at osgAnimation linking time.
I wonder why nobody noticed this on other platforms. I have updated the
CMakeLists.txt file in order to link to the needed libraries, and
3 - I have updated the openscenegraph-osgAnimation.pc.in file accordingly."