[x3d-public] negative scale and winding order

Andreas Plesch andreasplesch at gmail.com
Fri Mar 16 08:43:37 PDT 2018


Since winding order came up with how to split quads, here is another
issue connected to winding order. It is negative scaling factors on
transforms, and normals.

I have seen this discussed with three.js and with glTF which both
allow negative scaling for mirroring effects, as X3D does.

The issue is that after mirroring the winding order of each
triangle/quad needs to be reversed to ensure that it is consistent
with given, then mirrored normals or computed, then mirrored normals
or computed normals from reversed winding ordered triangles.

Since mirroring twice is of course possible, apparently the critical
value is the determinant of the final transform matrix. When it is
negative, winding order needs to reversed.

I am not sure how the ccw field should be taken into account.

This is perhaps only an implementation issue but I did not see
something in the spec on how given normals should be affected by
transforms with negative scaling. Presumably by ignoring the final
translation component and normalizing the transformed normal.

It may be ok to leave all of this alone in the spec. since there may
be no uncertainty what the final result should be, a properly mirrored
object.

-Andreas

-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list