Apache OpenOffice (AOO) Bugzilla – Issue 98295
3D charts are too dark
Last modified: 2009-02-26 10:03:00 UTC
Load the attached document and look at the 3D chart on the left side. Since dev300m30 it is very dark. On the right side there is a metafile showing how the chart looked like in OOo 3.0.
Created attachment 59537 [details] file showing the problem
The objects that are too dark now are created as shapes of service com.sun.star.drawing.Shape3DPolygonObject. If I change the direction of the normals that I set to property UNO_NAME_3D_NORMALS_KIND within the chart then the illumination is correct again. But as I haven't changed anything here within chart this should be changed behind the UNO API within draw thus other API users to not struggle over the same issue.
Investigated further I found out that it is not that simple just to reverse the normal. That does only help in case there is shading switched on. Without shading the 3D elements remain dark. I'll attach an example with two charts - one with and one without shading.
Created attachment 59558 [details] example with and without shading
AW: Checking the whole geometry preparation chain for 3D geometry, also the rendering proccess. There must be some difference in handling the normal creation. Maybe it has to do with automatic normal creation in the decomposers (e.g. in SdrExtrudePrimitive3D::createLocalDecomposition(...))...
AW: Problem found. Unfortunately, the definition of SdrObject E3dPolygonObj which allows a free 3d geometry definition was defined wrong topologically in relation to it's plane normal and 3D visibility when it was invented a long time ago. Since the API allows reation of this SDrObject type, it is not possible to simply change this definition. Only the chart should use it, and at least this object type only exists at Runtime (is not saved and/or loaded in any FileFormat). Still someone external may have used it in it's API. To not risk wrong 3D lightings, i have to switch the orientation of the polygon when creating the needed SdrPolyPolygonPrimitive3D in ViewContactOfE3dPolygon::createViewIndependentPrimitive3DSequence(). Checking further...
AW: Also added some data processing and lifetime optimizations to the DefaultProcessor3D::impRenderPolyPolygonMaterialPrimitive3D implementation. Also centralized tooling to work on normals on the primitive creation level. Added support for normal preparations to SdrPolyPolygonPrimitive3D, too. Testing...
AW: Works well, committed. Done.
AW->WG: Please review. Simplest is to use the bugdoc which shows a direct comparison.
Verified in CWS.
Tested in OOO310_m3. Closed.