Page 1 of 1

3D navigatoin with game controller

Posted: Tue May 08, 2018 12:19 pm
by PeterO
Does anyone have any tips/wisdom/experience/links to good tutorials about using game controllers to navigate a 3D scene ?

I've restarted work on the code shown running in this video:

That version used a track-ball and meta-keys for 3D navigation, but now I have a wireless game controller so I though I would try to use that instead for he 3D navigation. I have the basics working (Pan/Tilt on one stick. Move forwards/backwards and left/right on the other), but to be honest it's not working as well as I hoped. The old track-ball version seems easier to use (maybe only because I'm used to it ;) )

My biggest problem is that I need to be able to accurately place items (mostly small buttons) under the set of cross-hairs so that a controller button press will press the displayed button (see video for examples) but It seems much easier to do this with the track-ball that with the game controller.

Does anyone have any ideas on how to use the joystick motion/position to allow both quick motion about the scene AND accurate positioning over small items ? The controller also has the normal "rocker switch" buttons on the left and 4 press buttons on the right.


Re: 3D navigatoin with game controller

Posted: Thu May 10, 2018 3:06 pm
by PeterO
Here's my solution : "Snap to button". it took a bit of work because I had to reproduce the transformation in the vertex shader to work out where the buttons are actually rendered on the screen. This showed up some problems with my 4x4 matrix handling code. I think it was a case of two wrongs making a right as I had row/columns mixed up in two places !

Button nearest to the cross hairs cursor now turns green :-)