360 controller in Houdini

   5938   8   2
User Avatar
Member
51 posts
Joined: July 2005
Offline
I couldn't find anything via the search, has anybody successfully hooked up a Xbox 360 controller to Houdini, and can give me some tips on how to make that happen, please?

cheers

andre
User Avatar
Staff
2591 posts
Joined: July 2005
Offline
athomas
I couldn't find anything via the search, has anybody successfully hooked up a Xbox 360 controller to Houdini, and can give me some tips on how to make that happen, please?

cheers

andre

I think that the 360 controller is a USB device. So you might consider looking for a Python library to interface with the controller (maybe pygame?).

If so, it should be fairly straight-forward to create a python expression to access the controls.

Of course, I don't know how complicated it might get.
User Avatar
Staff
5158 posts
Joined: July 2005
Offline
If you are using Windows, you can proto-install the Joystick CHOP. It reads channels directly from the controller using DirectX. To install the CHOP:

1) run proto_install from the Houdini Command Prompt
2) Select the # for the Joystick CHOP
3) Restart Houdini

You can use Motion Effects to create a simple motion for a geometry (say, a Wave) and substitute the Joystick CHOP input instead. You will probably need to rename some of the channels to fit the channels you want to override.
User Avatar
Member
7722 posts
Joined: July 2005
Online
Currently, the Joystick CHOP proto-install not built on Win64 though.
User Avatar
Member
1390 posts
Joined: July 2005
Offline
Ha ha ha! Three sides of effects!
User Avatar
Member
51 posts
Joined: July 2005
Offline
Excellent, thanks guys, the joystick chop works like a charm.

Now all I have to do is figure out, how I can:

1. drive my position with it, so it's accumulative
2. be able to do 1 without having to play my timeline

If anybody has any ideas please feel free to chime in, much appreciated.

cheers

andre
User Avatar
Staff
5158 posts
Joined: July 2005
Offline
Well, unfortunately #1 and #2 are sort of mutually exclusive, if you're looking to drive something.

To accumulate position, you assume the channels coming from the Joystick CHOP are velocities, and use the Area CHOP to accumulate the positions. You'll need to turn on the Time Slice flag (Common tab) on the Area in order for this to work properly. You'll probably need to use a math CHOP before the Area to multiply the raw values of the Joystick CHOP to come up with decent velocities for you scene's scale. Set the export flag on the Area CHOP.

Then all you need to do is hit play (the mut. excl. thing I was mentioning earlier) and drive your object around.

If you want a more permanent copy of your motion, you can use a Record CHOP to capture the channels as you are performing them, and then lock it once you're happy with the results. You can use a Trim CHOP to cut out the area of interest, if there's a bit of a lag between you pressing start/stop and your performance.
User Avatar
Member
51 posts
Joined: July 2005
Offline
Awesome works like a charm.

A shame about not being able to do this without having to hit play, I wonder if I could somehow hook into tthe OGL call that drives the viewport and have the joystick node evaluate continuosly?

Just thinking out loud here, of course if anybody has ever attempted that please feel free to offer some tips/advice.

cheers

andre
User Avatar
Member
34 posts
Joined: Dec. 2008
Offline
I just want to mention that the python module pygame (pygame.joystick) is capable of interpreting joystick/controller movement.
  • Quick Links