<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Since the Normal node data is defined as MFVec3f type, which is vectors based on "single-precision floating points", and in section 5.3.5 <a href="https://www.web3d.org/documents/specifications/19775-1/V3.3/index.html" class="">https://www.web3d.org/documents/specifications/19775-1/V3.3/index.html</a> , single precision is described as requiring at least 6 (decimal) digits of precision. So a sensible specification for the normal vector data would be<div class=""><br class=""></div><div class="">abs( sqrt( n[0]*n[0] + n[1]*n[1] + n[2]*n[2]) - 1.0) <= 1.0e-6  , must be satisfied for each normal vector n with components n[i]</div><div class=""><br class=""></div><div class="">I judge it would be useful to include this in the specification. I don't judge it would be appropriate to specify what browsers should do for non-normalized normal vectors. This is the classic problem for software developers about hardest engineering factor, and that is users and the the mistakes they make -- and by users I mean content authors who don't properly prepare their models. Individual browsers need to make the tradeoff between accepting bad input and providing quality output; given that this tradeoff also depends on the target market.</div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 6, 2020, at 9:49 AM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" class="">andreasplesch@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I guess there are no immediate opinions on the requirement that normals need to be normalized to a length of 1.0.<div class=""><br class=""></div><div class="">How should a x3d browser process a normal with a length of 1.5 ?</div><div class=""><br class=""></div><div class="">A vote ? on:</div><div class=""><br class=""></div><div class="">a) give up. Invalidate the X3D. But what about a length of 1.01 ?</div><div class="">b) use as is but proceed in the processing of shading as if it is of length 1.0. May lead to rendering artefacts but I think this is the expected behaviour.</div><div class="">c) normalize the normal to 1.0 internally. I guess that is what the requirement tries to avoid browsers have to do but browser may already do it anyways for sanity reasons.</div><div class=""><br class=""></div><div class="">I pick b).</div><div class=""><br class=""></div><div class="">Cheers, -Andreas</div><div class=""><br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 28, 2020 at 12:53 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" class="">andreasplesch@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Looking at improving the pythonocc x3d generation, we came about the<br class="">
requirement in X3D that normals need to be normalized to unit length:<br class="">
<br class="">
<a href="https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#Normals" rel="noreferrer" target="_blank" class="">https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#Normals</a><br class="">
<br class="">
However, the spec. is silent on how precisely that requirement needs<br class="">
to be met. Is it required to be as precise as floats allow ? As an<br class="">
example, consider<br class="">
<br class="">
(0.9, 0.43588989435, 0)<br class="">
<br class="">
This vector has unit length given float precision limits.<br class="">
<br class="">
Would<br class="">
<br class="">
(0.9, 0.43589, 0)<br class="">
<br class="">
still be considered legal although it has a length of 1.00000004605 ?<br class="">
<br class="">
Does the X3D validator check for this requirement ?<br class="">
<br class="">
Thanks, Andreas<br class="">
-- <br class="">
Andreas Plesch<br class="">
Waltham, MA 02453<br class="">
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class="">Andreas Plesch<br class="">Waltham, MA 02453</div></div></div>
_______________________________________________<br class="">x3d-public mailing list<br class=""><a href="mailto:x3d-public@web3d.org" class="">x3d-public@web3d.org</a><br class="">http://web3d.org/mailman/listinfo/x3d-public_web3d.org<br class=""></div></blockquote></div><br class=""></div></body></html>