[x3d-public] Negative scale and ccw

Don Brutzman brutzman at nps.edu
Mon Mar 6 17:13:23 PST 2017


Thanks for raising this issue Andreas.  We should discuss further to resolve and use Mantis issue tracker accordingly.

Not remembering whether we discussed normals in detail when discussing addition of negative scale a few years ago.

I did a search on "webgl negative scale" and found this:

	http://stackoverflow.com/questions/13298396/webgl-negative-scale-normal

Using links in X3D Tooltips, found no relevant issues on x3d-public mailing list and one open issue in Mantis:

	876: 25.3.10 GeoTransform - Inconsistent scale field limits
	http://www.web3d.org/member-only/mantis/view.php?id=876

I think it best not to mention negative scale as part of ccw field per se, or any geometry/normal definitions, because the negative scaling value is not defined there.  Rather we can define how a Transform negative scale affects already-defined geometry coordinates and normals.  Spec sayeth:

	10.4.4 Transform
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#Transform

which says

	"The scale field specifies a non-uniform scale of the coordinate system. Scale values may have any value: positive, negative (indicating a reflection), or zero. A value of zero indicates that any child geometry shall not be displayed."

So perhaps this question reduces to whether a Transform reflection is sufficiently well defined?


On 3/5/2017 7:51 AM, Andreas Plesch wrote:
> X3D allows for negative scaling factors which result in reflections. A reflection will result in a reversal of the winding order of polygons and triangles.
>
> The CCW field http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#Geometricproperties defines the orientation of automatic normals relativ to the winding order.
>
> What is the orientation of automatic normals in a CCW=true geometry after a negative scale transformation ?
>
> The normals are constructed before the transformation. They are then scaled. A reflection say about the the YZ plane by a negative x scaling factor will not flip the normal but reverse the winding order.
>
> So the resulting winding order is now inconsistent with the orientation of the normals.
>
> However, in most cases this is what is intended by the scene author since a reflection should not result in suddenly showing the backfaces of triangles.
>
> I looked into this after discovering that three.js does not support negative scaling for probably good reasons:
>
> https://github.com/mrdoob/three.js/issues/4904
>
> What is the correct interpretation of CCW in a reflection ?
>
> Andreas

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list