ODF problems with 3D-objects

Regina Henschel rb.henschel at t-online.de
Mon Jun 3 20:18:48 UTC 2024


Hi all, hi Armin,

(A)
The UI-option "Double-Sided Illumination" (= UNO property 
D3DSceneTwoSidedLighting) is mapped to ODF scene attribute 
dr3d:lighting-mode (19.99.3, part 3, ODF 1.3).
Its specification is, "The dr3d:lighting-mode attribute specifies 
whether lighting is used in a three-dimensional scene.".

That is not implemented in LO. Lighting is always used in LibreOffice. 
Not using lighting would mean, that the fill color is not modulated but 
drawn as if the object is two-dimensional.


The ODF graphic property dr3d:lighting-mode(20.86, part3, ODF 1.3) fits 
neither. Its values are,
"double-sided: the front and back sides of all planes are displayed if 
they are visible from the viewer's perspective."
"standard: Depending on the value of the dr3d:normals-direction 20.87 
attribute, only the front or only the back side sides of the plane are 
displayed. The opposite sides are not displayed, whether they are 
visible from the viewer's perspective or not."
That is not about lighting, but about the visibility of object faces.


(B)
The UI-option "Invert Normals" (= UNO property D3DNormalsInvert) is 
mapped to ODF graphic property dr3d:normals-direction (20.87, part 3, 
ODF 1.3). Thereby the value D3DNormalsInvert=true is mapped to 
dr3d:normals-direction="normal" and D3DNormalsInvert=false is mapped to 
dr3d:normals-direction="invert".

For dr3d:normals-direction is specified, "The dr3d:normals-direction 
attribute has no effect if the dr3d:lighting-mode 20.86 attribute has 
the value double-sided". But the graphic property dr3d:lighting-mode 
20.86 is not implemented in LibreOffice at all. Its value is not read 
and not written.


(C)
The light position is determined by Svx3DLightControl() in the UI. It is 
associated with UNO properties D3DSceneLightDirection1 to 
D3DSceneLightDirection8. A position in the center in front of the sphere 
in the control results in D3DSceneLightDirection1 = {DirectionX=0, 
DirectionY=0, DirectionZ=1}, for example. This is mapped to ODF 
attribute dr3d:direction (19.95, part 3, ODF 1.3) as dr3d:direction="(0 
0 1)" for the example. The attribute dr3d:direction is specified as, 
"The dr3d:direction attribute specifies the direction in which light is 
emitted.".

So LO uses it as position, but for ODF it is a direction, a vector.


(D)
The UI-option "Double-Sided" (=UNO property D3DDoubleSided) is mapped to 
ODF graphic property dr3d:backface-culling (20.76, part3, ODF 1.3). In 
my understanding, if "backface-culling" is enabled it means, that object 
polygons, which are not visible to the viewer are skipped on rendering. 
In case of solid filling this would have no effect on the final result, 
but only reduces the time for rendering. But in LO the effect is, that 
object polygons, which are not visible because the viewer looks on the 
back face, become visible when backface-culling is disabled. That 
behavior would more fit to ODF dr3d:lighting-mode="double-sided" (20.86).

(E)
In my understanding, a normal determines which side of an object polygon 
is the front face and which is the back face. When I assume an object 
polygon is not visible because the viewer looks on the back face, then 
when changing the state of "Invers Normals" those polygons which were 
invisible become visible and vice versa. But that is not the case in 
LibreOffice.

Is my view in (D) and (E) correct?


Do you agree, that there is a mess? And if yes, how we can fix it?

Kind regards,
Regina


More information about the LibreOffice mailing list