View Full Version : Do you have some idea about the bicycle and wheel

07-04-2003, 10:14 AM
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!

07-07-2003, 10:29 AM

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.

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.

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 )

07-07-2003, 11:49 AM

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.

07-08-2003, 06:29 AM
Thanks a lot:)

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"?


08-01-2003, 10:03 PM

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

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.

This returns whether the trigger button has been pressed

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

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

This returns the position of the slider

This returns the value of the hat switch

This returns some auxillary values

This sets the value for force feedback