Can't get other effects (shaders) with pushbutton controller

Home Forums AR Sandbox Forum Can't get other effects (shaders) with pushbutton controller

Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by  leroywong 2 weeks, 5 days ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #118514

    leroywong
    Participant

    We bought a pushbutton controller to toggle through other effects like lava, snow, and toxic waste, but we can’t get it to work. We did get lava to work once with a keyboard shortcut, but that doesn’t seem to work now either. Any assistance that folks could give would be greatly appreciated. This is from a config file that was posted in a Facebook AR Sandbox group.

    We just did this! We bought the Delcomm quad button switch and assigned each button a job:
    1. Blue: Makes it flood
    2. Green: Dries it up
    3. Orange: toggles between normal, lava, snow, black and white
    4. Red: Takes a screen shot and uploads it to a Google Doc folder

    Here is our SARndbox.cfg file for this:
    section Vrui
    section Desktop
    section Window
    windowFullscreen true
    # Window endsection
    endsection

    section MouseAdapter
    mouseIdleTimeout 5.0
    # MouseAdapter endsection
    endsection

    section HIDAdapter
    inputDeviceAdapterType HID
    inputDeviceNames (ButtonBox)

    section ButtonBox
    name ButtonBox
    deviceVendorProductId 0fc5:b080
    # buttons:
    # Blue 166
    # Green 167
    # Orange 168
    # Red 169
    # ButtonBox endsection
    endsection

    # HIDAdapter endsection
    endsection

    inputDeviceAdapterNames (MouseAdapter, HIDAdapter)

    section Tools

    toolClassNames += (ScriptExecutorTool)

    section DefaultTools

    section KeyboardWaterTool
    toolClass GlobalWaterTool
    # The “Mouse” section sets keyboard numbers for water, drying
    bindings ((Mouse, 1, 2))
    # WaterTool endsection
    endsection

    section ButtonBoxWaterTool
    toolClass GlobalWaterTool
    # The “ButtonBox” section adds the Delcom settings
    # we want blue (166) and green (167).
    bindings ((ButtonBox, Button166, Button167))
    # WaterTool endsection
    endsection

    section KenFartsALot
    toolClass ScriptExecutorTool
    bindings ((ButtonBox, Button168))
    executablePathName /home/montgomery/OrangeButton.sh
    endsection

    # Use the Script Executor tool to take the screenshot
    # since the builtin screenshot tool isn’t working
    section ButtonScripts
    toolClass ScriptExecutorTool
    bindings ((ButtonBox, Button169))
    executablePathName /home/montgomery/take-screenshot
    endsection

    # DefaultTools endsection
    endsection
    # Tools endsection
    endsection
    # Desktop endsection
    endsection

    # Vrui endsection
    endsection

    And here is how we programmed the orange button to toggle between the environments, including lava:
    #!/bin/sh
    #
    # We keep a file around that contains our current state.
    curstate=cat /tmp/orangeState
    #
    # Now, we cycle from current state -> new state.
    # The states are:
    # color -> lava -> snow -> b&w
    # (water) (color) (color) (water)
    #
    # If we can’t figure out what state we were in,
    # we go to lava.
    water=Water
    color=Color
    case X”$curstate” in
    Xlava)
    newstate=snow
    water=Snow
    ;;
    Xsnow)
    newstate=bw
    color=BW
    ;;
    Xbw)
    newstate=color
    ;;
    *)
    newstate=lava
    water=Lava
    ;;
    esac
    echo $newstate > /tmp/orangeState
    sardir=/home/peggy/src/SARndbox-2.3
    echo “colorMap $sardir/etc/SARndbox-2.3/Height${color}Map.cpt” > $sardir/fifodir/controlfifo
    shaderdir=$sardir/share/SARndbox-2.3/Shaders
    cp $shaderdir/SurfaceAddWaterColor-${water}.fs $shaderdir/SurfaceAddWaterColor.fs

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Comments are closed.