WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Do you have some idea about the bicycle and wheel (https://forum.worldviz.com/showthread.php?t=42)

sled 07-04-2003 10:14 AM

Do you have some idea about the bicycle and wheel
 
hi, in our applications, we need to use a bicycle to get the speed and direction of the subjects, these data are sent in my computer from the serial port, do I need to make a plug-in like the flock of birds to use these data.

another problem is about wheel, the game wheel with the accelerator and brake, how can I use it to move in the vizard environment instead of the mouse.

Good wishes!

farshizzo 07-07-2003 10:29 AM

Hi,

To get data from the serial port within your script you will want to create a Sensor Plug-in. You will need to program in C/C++. If you are interested in this we can give you the appropriate header files and an example.

Vizard supports joysticks through a library called sid. You would probably want to create a timer that checks the current state of the joystick and updates the view. Here's is some sample code for using the joystick.

Code:

import sid
.
.
.

def mytimer(num):

    buttons = sid.buttons()
    if buttons & 1:
        print 'Button 1 is down'
    if buttons & 2:
        print 'Button 2 is down'
    if buttons & 4:
        print 'Button 3 is down'
   

    data = sid.get()
    print 'X axis of joystick at', data[0]
    print 'Y axis of joystick at', data[1]

    slider = sid.slider()
    print 'Joystick slider at', slider

If you have any more questions I'll be happy to help you.

sled 07-07-2003 11:15 AM

Thanks, I found the plug_in API in your help document. if you have some real examples, it's great.

by the way, in your help document ,under Avatar object,it shows
"The avatar library also includes tools to integrate custom heads made with 3DMeNow Professional software by www.biovirtual.com. This software let you create a realistic head of a person from a front and profile photograph."

but I cannot find the tools( to integrate my file made with 3DMeNow )

farshizzo 07-07-2003 11:49 AM

Hi,

I'm going to post an example of a plug-in in the "Plug-in Development" section. I'll also be posting the tools and instructions on creating custom heads for the Avatars.

sled 07-08-2003 06:29 AM

Thanks a lot:)

jrodman 07-30-2003 02:47 PM

Is there any more documentation on how to use the sid library to get joystick input?

If not, could you post the header files for the dll so I can see what functions are available?

Does it support an "8-way POV Switch"?

Thanks

farshizzo 08-01-2003 10:03 PM

Hi,

Here is a list of the available commands in the sid library, I believe the hat command is what you are looking for.

get
This returns a list of three values. The first value is the x position of the joystick. The second value is the y position of the joystick. The third value is a number where each bit represents whether a certain button is down.

trigger
This returns whether the trigger button has been pressed

buttons
This returns a number where each bit represents whether a button is down

angle
This is a helper function that returns the angle the joystick is pointed at.

slider
This returns the position of the slider

hat
This returns the value of the hat switch

aux
This returns some auxillary values

set
This sets the value for force feedback


All times are GMT -7. The time now is 02:07 PM.

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