VR system with nexuiz

Discuss anything to do with Nexuiz here.

Moderators: Nexuiz Moderators, Moderators

VR system with nexuiz

Postby erroneus » Tue Jan 08, 2008 1:27 am

i know what your thinking, why would anyone want to do that?
well, my reason is a little long to post here, but basicly, i'm trying to build an affordable VR system by means of a head tracking device. (school project) it would work on any platform that can use joystick, mouse, and keyboard. Nexuiz seems to have all 3. (and is open source if i'm not mistaken)
i've taken a look at the wiki and controls, and it seem that the engine has the capability of rotating the camera (tilt with strafe or death), but how could i control it (or add an control) that is from a mouse axis (or joystick)? (specifically the z axis... which i only found out because directX has a z axis for the mouse for some reason)

so, is this possible?

edit: this thread has evolved beyond that of rotating the camera with mouse, see newer posts
Last edited by erroneus on Tue Feb 19, 2008 8:28 pm, edited 1 time in total.
erroneus
Member
 
Posts: 12
Joined: Tue Jan 08, 2008 1:10 am

Postby Psychcf » Tue Jan 08, 2008 2:31 am

you mean like in older FPS games? I'm sure it's possible, but I dunno.
Psychcf
Forum addon
 
Posts: 1554
Joined: Sun Dec 03, 2006 11:38 pm
Location: NY, USA

Postby TVR » Tue Jan 08, 2008 3:02 am

Fortunately, such will be easier that camera tilting is fairly trivial; and stereo GL projection is already supported.

Unfortunately, as Nexuiz uses OpenGL, you'll have to code in such support for [1] Determining the pitch, yaw, and roll of such head tracking device [2a] Mapping such movements towards cursor/joystick movement & acceleration OR [2b] Directly translating such movement in Darkplaces to camera movement.
TVR
Alien trapper
 
Posts: 404
Joined: Fri Jun 01, 2007 12:56 am

Postby erroneus » Wed Jan 09, 2008 8:21 pm

well i guess it couldn't hurt to provide a little more info as to what i'm doing

i'm using a program called GlovePIE to remap devices onto other devices, so i could use a joystick or such to controll a mouse etc..
in this specific project, i started with a wiimote, but since the wiimote cannot detect yaw, i'm migrating towards the PS3 sixaxis controller.
i've already created a script that converts the angle of pitch into mouse movment that results in looking up or down.
it is actually quite simple, i can do the same with yaw once i get a ps3 controller, tilt/rotation can be controlled this way too, however i couldn't find any console commands or variables that would allow for direct camera controll with the mouse.

any tips on where i could start if i wanted to add my own?
erroneus
Member
 
Posts: 12
Joined: Tue Jan 08, 2008 1:10 am

Postby KadaverJack » Wed Jan 09, 2008 8:49 pm

There's support for a cvar called joy_axisroll in vid_sdl.c, but all references are commented out.
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby erroneus » Wed Jan 09, 2008 11:30 pm

thanks! not sure what i can do, but its a start!
erroneus
Member
 
Posts: 12
Joined: Tue Jan 08, 2008 1:10 am

Postby [-z-] » Thu Jan 10, 2008 5:45 am

This sounds like it could get interesting. Please keep us updated.

edit: http://www.cs.cmu.edu/~johnny/projects/wii/
[-z-]
Site Admin and Nexuiz Ninja
 
Posts: 1794
Joined: Mon Nov 13, 2006 12:20 am
Location: Florida

Postby erroneus » Wed Jan 23, 2008 7:04 pm

well, i wasn't able to get the view to rotate with the mouse, but once i figured out how to compile into a binary, it was pretty easy to remove the // and get the code to work, i modified it a bit, so that holding the joystick position will determin the roll position, (i removed a + and increased sensitivity) problem is though that it is really shakey at the extremes.
other than that, i just have to work on my glovepie script a bit more.

i want to build a map that makes the user cross over an abyss via narrow beam. (using the vr helm) i have to come up with a way to track walking motion from the user and put that into the game. accelerometers could work, but the math involved is a little difficult for me.
erroneus
Member
 
Posts: 12
Joined: Tue Jan 08, 2008 1:10 am

updated VR stuff

Postby erroneus » Sun Feb 10, 2008 4:24 am

I have a quick demo of what i have been able to do so far, but there is one thing that i hope i can get help with.

on line 293 of vid_sdl.c i changed the code from
Code: Select all
cl.viewangles[2]   += IN_Joysti........
to
cl.viewangles[2]   = IN_Joysti...........


also there was a speed variable at the end of the line that i commented out because it gave me a declaration error when compiling, (i replaced it with an arbitrary number of 200)
anyways, i took out the + so that the view angle would corispond with the position of the joystick (and therefor the positon of the ps3 controller)

what i need help with is that when i am holding the joystick (virtual or real) at a constant value, the camera jitters like crazy, the further i push it, the more jitter there is.
i've managed to fix some of it by removing code that was found in cl_input.c
(commented out line 400
Code: Select all
cl.viewangles[ROLL] = ANGLEMOD(cl.viewangles[ROLL]);


i also took out the bounding code on line 409
Code: Select all
cl.viewangles[ROLL] = bound(-50, cl.viewangles[ROLL], 50);

and that stopped the jitter when the angle is maxed out
any suggestions?

it may help you to know what i'm doing with the VR stuff
if you are a little confused, i've published what i'm doing on my website, i have a video of my customized nexiuz in action too!

http://joelclemens.colinr.ca/stuff.html
erroneus
Member
 
Posts: 12
Joined: Tue Jan 08, 2008 1:10 am

Postby [-z-] » Sun Feb 10, 2008 3:05 pm

Nice man, looking real good.
[-z-]
Site Admin and Nexuiz Ninja
 
Posts: 1794
Joined: Mon Nov 13, 2006 12:20 am
Location: Florida

Next

Return to Nexuiz - General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron