[x3d-public] BooleanFilter inputFalse output value true or false ?
Don Brutzman
brutzman at nps.edu
Fri Sep 8 15:52:17 PDT 2017
On 9/8/2017 9:28 AM, Joe D Williams wrote:
>> I hope it means agreement, that inputTrue field passes TRUE event and inputFalse field passes a FALSE event.
>
> ... and that there is an invert of the input.
yes:
- inputTrue only passes TRUE events
- inputFalse only passes FALSE events
- inputNegate passes the opposite of the input
http://www.web3d.org/x3d/content/X3dTooltips.html#BooleanFilter
> -----Original Message-----
>> From: Don Brutzman <brutzman at nps.edu>
>> Sent: Sep 5, 2017 10:35 PM
>> To: Joe D Williams <joedwil at earthlink.net>
>> Cc: Andreas Plesch <andreasplesch at gmail.com>, X3D Graphics public mailing list <x3d-public at web3d.org>
>> Subject: Re: [x3d-public] BooleanFilter inputFalse output value true or false ?
>>
>> gee Joe, pretty cryptic!
>>
>> I hope it means agreement, that inputTrue field passes TRUE event and inputFalse field passes a FALSE event.
>>
>> On 9/4/2017 7:25 PM, Joe D Williams wrote:
>>> SFBool => SFBool
>>> Produce inputNegate and either inputTrue or inputFalse
>>> set_boolean|notset_boolean => negateset_boolean+(inputTrue|inputFalse)
>>>
>>>
>>> Thanks,
>>> Joe
>>>
>>> -----Original Message-----
>>> From: Andreas Plesch
>>> Sent: Sep 4, 2017 12:14 PM
>>> To: Don Brutzman
>>> Cc: X3D Graphics public mailing list
>>> Subject: Re: [x3d-public] BooleanFilter inputFalse output value true or false ?
>>>
>>> freewrl also uses inputFalse with a false value but not without a dedicated comment:
>>>
>>> https://sourceforge.net/p/freewrl/git/ci/master/tree/freex3d/src/lib/scenegraph/Component_EventUtils.c#l45 <https://sourceforge.net/p/freewrl/git/ci/master/tree/freex3d/src/lib/scenegraph/Component_EventUtils.c#l45>
>>> https://sourceforge.net/p/freewrl/git/ci/master/tree/freex3d/codegen/VRMLNodes.pm#l2644 <https://sourceforge.net/p/freewrl/git/ci/master/tree/freex3d/codegen/VRMLNodes.pm#l2644>
>>>
>>> -Andreas
>>>
>>>
>>> On Mon, Sep 4, 2017 at 9:49 AM, Andreas Plesch <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>> wrote:
>>>
>>> I agree, inputFalse should produce false since BooleanFilter is designed as a pass through filter. It is just a matter of the spec. language being a bit too concise.
>>> 'based on the Boolean value received' mostly refers to which of the possible output event should be generated, inputTrue or inputFalse. But the phrase is ambiguous with regards to the associated values.
>>>
>>> What about
>>>
>>> 'When the set_boolean event is received, the BooleanFilter node generates two events: either inputTrue with a value of true or inputFalse with a value of false, depending on the Boolean value received;...' ?
>>>
>>> But since the question was raised, let's explore the design to see if is possible to decide which behaviour may be more useful. How may BooleanFilter be used ?
>>> Sensors are probably the main sources of boolean outputs. Filtering a sensor output makes it possible to selectively choose separate responses to the output. It is a kind of branching. This branching is achieved by having either inputTrue or inputFalse events but is independent of their values.
>>> Considering a 'false' output value as something positive (true) may often be appropriate but completely depends on the scene architecture. So I follow Don's reasoning that it is best to keep it simple by forwarding the input values.
>>>
>>> -Andreas
>>>
>>>
>>> On Mon, Sep 4, 2017 at 12:39 AM, Don Brutzman <brutzman at nps.edu <mailto:brutzman at nps.edu>> wrote:
>>>
>>> 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 <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 <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 <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 <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 <mailto:brutzman at nps.edu>
>>> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149 <tel:%2B1.831.656.2149>
>>> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman <http://faculty.nps.edu/brutzman>
>>>
>>>
>>>
>>>
>>> --
>>> Andreas Plesch
>>> Waltham, MA 02453
>>>
>>>
>>>
>>>
>>> --
>>> Andreas Plesch
>>> Waltham, MA 02453
>>>
>>
>>
>> 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
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