x3dom / x3dom

X3DOM. A framework for integrating and manipulating X3D scenes as HTML5/DOM elements.
http://x3dom.org
Other
815 stars 271 forks source link

support negative scale for glTF #1298

Closed andreasplesch closed 9 months ago

andreasplesch commented 9 months ago

https://github.com/KhronosGroup/glTF-Asset-Generator/blob/master/Output/Positive/Node_NegativeScale/README.md

has a series of glTF tests which use negative scaling.

They require flipping of the ccw field of BufferGeometry in case the world transform determinant is negative.

andreasplesch commented 9 months ago
isCCW : function ()
            {
                var ccw = this._cf.geometry.node._vf.ccw;
                if ( x3dom.isa( this._cf.geometry.node, x3dom.nodeTypes.BufferGeometry ))
                {
                    if ( this._graph.globalMatrix.det() < 0 ) return !ccw
                }
                return ccw;
            },
andreasplesch commented 9 months ago

1301