[x3d-public] BooleanFilter inputFalse output value true or false ?

Don Brutzman brutzman at nps.edu
Sun Sep 3 21:39:04 PDT 2017


great question, thanks Andreas.  let's explore.

On 9/3/2017 8:18 PM, Andreas Plesch wrote:
> Looking at BooleanFilter (http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/utils.html#BooleanFilter) I could not decide what the boolean output values for the inputTrue and inputFalse events were.
> 
> The spec. just has:
> 
> 'BooleanFilter node generates two events: either inputTrue or inputFalse, based on the Boolean value received; ...'

full prose:

"BooleanFilter filters Boolean events, allowing for selective routing of TRUE or FALSE values and negation.

When the set_boolean event is received, the BooleanFilter node generates two events: either inputTrue or inputFalse, based on the Boolean value received; and inputNegate, which contains the negation of the value received."

> Especially, the value for inputFalse is difficult to determine. I actually was leaning towards the value true for inputFalse when the received value is false since it is then true that the input value was false.

yes the semantics of the spec phrasing is a bit ambiguous.  we should get more explicit.

> However, the tooltips here
> 
> http://www.web3d.org/x3d/content/X3dTooltips.html#BooleanFilter
> 
> claim that the inputFalse value should be false instead, passing on the value of the input.

reviewing now, i think that is correct, since it is closely following the initial spec sentence clause "based on the Boolean value received".

of additional note is the figure that was reviewed by a number of people, linked in tooltips:

	Hint: X3D Event-Utility Nodes, Field Event Diagrams
	http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/X3dEventUtilityNodeEventDiagrams.pdf

attached is image excerpt showing BooleanFilter inputs/outputs, plus copy of diagram for convenience.

> Is that really what other x3d browsers do ?

yes it is good to check.  perhaps a more explicit test scene will help also.

I think that [inputFalse passing FALSE] is indeed the right approach, for a few reasons:

a. the node name BooleanFilter indicates a filtering action, i.e. only passing some things through, rather than changing them

b. if an author filters an event stream to detect a FALSE event, it is detected and usable as such, rather than requiring yet-another negation.

c. precise logic like this leads to more succinct and less error-prone event chains.

> Checking cobweb it appears that it rather uses inputFalse=true here:
> 
> https://github.com/create3000/cobweb/blob/master/src/cobweb/Components/EventUtilities/BooleanFilter.js#L110

good check, we need to make them all consistent.

> It looks like clarification is needed,

yes, further comment welcome.  once we're clear, let's

d. have an explicit test scene,
e. have specific spec prose and perhap add the diagrams,
f. add an inputFalse Warning to ensure no ambiguity remains.

> -Andreas

thanks!

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BooleanFilterFieldEventDiagramExcerpt.png
Type: image/png
Size: 26286 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170903/b19ccb05/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: X3dEventUtilityNodeEventDiagrams.pdf
Type: application/pdf
Size: 32395 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170903/b19ccb05/attachment-0001.pdf>


More information about the x3d-public mailing list