WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Joystick setForce (https://forum.worldviz.com/showthread.php?t=2743)

tsgk 05-19-2010 05:59 AM

Joystick setForce
 
Hello all,

I have a (hopefully) quick question with regards to one of the joystick options, the .setForce([x,y]) where [x,y] is the force vector you want to set to the FFB device.
Has anyone used this command succesfully to moderate the strength of the FFB? There are no examples in the Help files.. Help!! How do I use this? What values can I put to the force vector?

Thanks in advance!!

levisii 05-31-2011 04:35 AM

Hi,

did you try the .hasFFB() function? I was wondering too, why I'm not able to generate any ff-effect. Seems like the ffb-function of my joystick can't be identified. This is my testprogram:

Code:

import viz
import vizjoy

viz.go()
joystick = vizjoy.add()
print 'FFB = ' + str(joystick.hasFFB())

def joyButton(e):
        if e.button == 1:
                joystick.addForce(0.5,0)
                print '1'
               
        if e.button == 2:
                joystick.setForce(0,0.5)
                print '2'
               
        if e.button == 3:
                e.joy.addAction(vizjoy.recoil(0.8))
                print '3'
               
        if e.button == 4:
                e.joy.addAction(vizjoy.rumble(0.4))
                print '4'

viz.callback(vizjoy.BUTTONDOWN_EVENT,joyButton)

this is my print out:

** NOTIFY: 1 joystick(s) detected
1 - Logitech Force 3D Pro
** NOTIFY: Connected to Logitech Force 3D Pro
Supported: X Axis, Y Axis, Rz, Slider, 12 Buttons, Hat switch,
FFB = False

levisii 06-07-2011 06:09 AM

update:

Well, it was just a problem with the driver. The example is working now.


All times are GMT -7. The time now is 11:12 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC