Graphics

 View Only
  • 1.  Boolean Logic oddities

    Posted 07-31-2017 22:27
    I have 2 objects' visibility parameters, which give boolean values of 0 when off, and 1 when on. These are connected to an AND node. An AND node should require both elements to be in the same state in order for it to change its output value, however having either one of these two visibility toggles set to off, the result coming out of AND is a 0, despite one of the visibility nodes returning a 1. The behavior of the AND node is therefore what one would expect from an OR node in which the value would change if ANY connected node's value changed.

    Or am I missing something?


  • 2.  RE: Boolean Logic oddities

    Posted 07-31-2017 22:43
    Keep in mind, I CAN get done what I want done with an OR node, but, like my post a couple weeks back on the >= node, I contend that the function vs the descriptor is at best, counter-intuitive.
    #XPression


  • 3.  RE: Boolean Logic oddities

    Posted 07-31-2017 23:47
    Please upload a sample so we can see what you are seeing.
    #XPression


  • 4.  RE: Boolean Logic oddities

    Posted 07-31-2017 23:50
    I just tested for myself and had no issues with the AND block. When both inputs were 1 the output was 1.
    #XPression


  • 5.  RE: Boolean Logic oddities

    Posted 08-01-2017 18:04
    Right, but it was also 1 when only 1 of the inputs was 1. It seems to me the output of and AND operation should require all inputs to be a given value before the output changes. In my head it's like this:
    If x AND y =1 then output =1
    If x=1 and y=0, or x=0 and y=1, or x=0 and y=0 then output = 0

    I understand that's not the intent, it's just a difference between the way my mind works and the way VL is setup to operate, but it throws me for a loop sometimes.
    #XPression


  • 6.  RE: Boolean Logic oddities

    Posted 08-01-2017 19:49
    That is how it should work, and the intent. I need to see your scene to see why you are not getting this behavior.
    #XPression


  • 7.  RE: Boolean Logic oddities

    Posted 08-01-2017 19:52
    Try creating very simple scene with two objects visibilties hooked up to an AND block, and the output feeds the visibility of a third block.
    You should fine that only when X and Y are both visible, is when the output should be visible.

    I suspect your original scene has something much more complex going on and there may be some other reason why it appears that the AND block is not working like you expect.
    #XPression


  • 8.  RE: Boolean Logic oddities

    Posted 08-01-2017 20:29
    It was actually a very simple setup for a pretty basic graphic. I had 2 stat lines below a divider (a textured quad). I wanted the divider to hide only when the visibility of both stat lines was turned off, Instead the divider would hide when either of the stat lines were off. I got the desired behavior out of the OR block, which I found odd, but I just accepted it. It's delivery week for these elements so I have to make it work and move on, but I hope to revisit some of this stuff once the dust settles.
    #XPression


  • 9.  RE: Boolean Logic oddities

    Posted 08-02-2017 00:30

    Hi Willie,

    You previously described an AND block (correctly I might add).
    It is like this:
    AND
    X | Y | Output
    0 | 0 | 0
    0 | 1 | 0
    1 | 0 | 0
    1 | 1 | 1


    An OR block is like this:

    OR
    X | Y | Output
    0 | 0 | 0
    0 | 1 | 1
    1 | 0 | 1
    1 | 1 | 1



    In your description of what you intended the graphic to do, you said you wanted the divider to be hidden ONLY when both stat lines are not visible. This is not what an AND block will do.
    Example. Here is what you wanted:

    Stat1 | Stat2 | Divider
    0 | 0 | 0 (hidden only when both stats are off)
    0 | 1 | 1 (visible when either stat is shown)
    1 | 0 | 1
    1 | 1 | 1


    Compare that with the two tables of AND and OR above, and you will find that what you actually should use is the OR block (as you discovered through trial and error).


    #XPression