thanks for your replies guys, just another update.
i managed to fix the jitter in the roll by reading the data directly from the joystick SDL.
not too bad considering i can't really program in C what-so-ever (what i've done is basically from a result of reverse engineering)
so i've compiled a new version that reads absolute positional data from the joystick on both roll and pitch, (freeing up the mouse forward axis for possbly walking forward)
i've uploaded my windows binary and my new glovepie code to my website. (along with a better video outlineing the project)
http://joelclemens.colinr.ca/stuff.html
here is the code i used to fix the jitter:
as an example for the pitch i replaced
- Code: Select all
cl.viewangles[0] += IN_JoystickGetAxis(joy, joy_axispitch.integer, joy_sensitivitypitch.value, joy_deadzonepitch.value) * cl.realframetime * cl_pitchspeed.value;
with this
- Code: Select all
cl.viewangles[0] = (SDL_JoystickGetAxis(joy, joy_axispitch.integer) * 90 / 32767)
in glove pie, i map out the pitch angle from -1 to 1 for -90 to 90 degress, and works quite well. (using this new code, i don't need to worry about anglemod or bound, as it takes care of itself)
oh and i also fixed the wording on my assumption that nexuiz was directly related to the quake 1 engine.
remaining issues that i'm looking for help with is motion tracking, you can see in my latest video that i have a sort-of working prototype of motion tracking, its using the mousewheel on a cordless mouse. i just used the smooth function in glovepie to map it to the joystick for forward motion.
you may ask, why didn't i the now available forward axis of the mouse?
well, using an optical mouse would be great, but i didn't have a way to block the side/lateral axis, so any slight side to side motion screws up the head tracking (because its mapped to the mouse driver)
so i used a ball mouse.... i put some tape on the IR led that was part of the ball tracking, but the ball wouldn't really grip the carpet as well as the mouse wheel.
my original plan was to re-wire the mouse so that the left/right axis is putting data on the mousewheel signal, so i would be able to use the mouse to go left right, forward and backward, but the damn crappy cordless mice i have, (logitech) have some issue where you can't spin the mousewheel and move the mouse at the same time without some lag... i dont have this issue on my corded microsoft mouse.. i guess it might have something to do with wireless bandwidth.
oh, and i got my project featured on hack a day
http://www.hackaday.com/2008/02/09/cheap-360-degree-head-tracking/
since then i've emailed gizmodo, but nothing yet.
i've had a suggestion from the creator of GlovePIE to use a step counter (pedometer) along with the accelerometers to account for direction. i'm considering this, but the problem is the nature of the step counter vs the actual motion i'm trying to achieve.
(it would be easy to wire in the pedometer into a mouse or something and count mouse clicks.. more clicks = higher joystick level = speed increases in game).. this approach would be very laggy i think.