Wiimote Project » Wiimote Projects » Wiimote Desktop VR/Head Tracking » VR Headtracking in Linux with OpenGL - working!
: [1]
   
: VR Headtracking in Linux with OpenGL - working!  ( 13719 )
0 and 1 Guest are viewing this topic.
*
Karma: +1/-0
: 8
Offline Offline
« : May 01, 2008, 02:20:44 AM »

I spent some time testing out the various "head tracking" demos written with OpenGL and none were complete. Many lacked wiimote support, and others simply didn't get the perspective transformation right. A few weekends ago I picked up a wiimote and wrote this program over the course of a few days. Many thanks to Johnny Lee for making the original version for Windows! His project was obviously my inspiration for this :D.

Note that although the code works fine on my machine, you'll need to compile it once you set up your screen and IR bar settings. I suggest familiarizing yourself with the code before you compile and run it. Make sure you have the cwiid library and MesaGL/GLUT.
I admit that it's quite unpolished at the moment, but I see a LOT of questions about how to do this in OpenGL so I wanted to release the code so others don't have to bang their head on walls anymore trying to understand this. I will be improving the documentation over the next few weeks, as well as writing a tutorial on how the perspective transform works, including pretty diagrams for all of those who can't learn without ;D.

I posted my code here:
http://stsnyder.bol.ucla.edu/
Click on "Wiimote Projects"

It's written in C and uses the cwiid library for wiimote access.

It does not currently support textures or any other goodies like that. The targets are draw as two quads each. I drew a grid with lines for reference. I will clean up the appearance in the next few versions.

In the next version I will have a better interface for setting it up for your screen and IR light bar. I have have a bunch of other projects going on right now, so I'm sorry I can't work on this at the rapid pace I did when I just wanted to get it working.
Yes, the perspective correction works PROPERLY. I've seen a lot of demos that just move the camera around, without doing the proper transformation.

Thanks,
Steven Snyder
*
Karma: +1/-0
: 8
Offline Offline
« #1 : May 22, 2008, 01:47:27 AM »

 :o 180+ views and no replies?
Has anyone tried out my program?
*
Karma: +0/-0
: 1
Offline Offline
« #2 : May 24, 2008, 01:05:57 PM »

Just tried it, and it works for me, thanks. Will play with it more after I alter some glasses with IR LEDs...

/Rick
*
Karma: +0/-0
: 1
Offline Offline
« #3 : May 25, 2008, 05:37:35 AM »

It took me a little while to get it working (I didn't realise I had to install the dev packages for cwiid and glut).

Thank you so much! The Windows version blue screened my laptop, but this version works just fine on my Ubuntu-powered media center :-D
*
Karma: +0/-0
: 1
Offline Offline
« #4 : May 26, 2008, 04:53:52 PM »

Hey Steven,

I've been cursing the need to get windows installed to try this demo for over a month now - finally found a spare machine, put windows on it, and was just thinking about trying to get the bluetooth stack working when I saw your post.

I installed the deps the guy above mentioned, typed "make" and ran it.  Held buttons 1&2 down, ran it again, and wow - it just worked!  I didn't have the IR bar to hand and had a quick go with my TV remote (which didn't do the trick) but then I noticed that my living room lights seem to emit some IR which let me demo that it works.

Good work - this is great - I'm going to have a play with the code later once I've sorted out a pair of special IR specs ;-)  If I do make any modifications I'll post them back to you.  (C isn't my strong point so it's quite possible I might not manage to do anything worthwhile!)

Dave
*
Karma: +1/-0
: 8
Offline Offline
« #5 : May 30, 2008, 06:34:17 PM »

Hi guys, thanks for the replies. I'm glad its working for you.  :D

My apologies for the lack of updates; I've been working on a computational genetics project and all of my programming time has been going to that for the last month.

Enjoy!
*
Karma: +1/-0
: 8
Offline Offline
« #6 : June 08, 2008, 02:30:43 AM »

I had a newer version sitting on my computer that I forgot to upload. It's up now. I got rid of those horizontal grid lines on the front of the screen; those were just for testing purposes.. I didn't mean to leave them in the last release. Sorry about that! Looks clear now.

-Steven
*
Karma: +1/-0
: 8
Offline Offline
« #7 : June 10, 2008, 12:37:14 AM »

I reorganized and rewrote the code. The project will now be developed in C++.

Here is the latest (C++) version. It has identical functionality to the previous version, but the settings are now in a seperate header file, and the code is overall much easier to work with.

http://stsnyder.bol.ucla.edu/projects/wiimote/trackingdemo0.30.tar.gz
*
Karma: +0/-0
: 3
Offline Offline
« #8 : May 07, 2010, 05:17:07 AM »

Hi,

I download your program. However I encountered an error while compiling.

+ cc wiiheadtracking.cpp
cc1plus: warnings being treated as errors
wiiheadtracking.cpp: In constructor ‘TrackWiimote::TrackWiimote()’:
wiiheadtracking.cpp:66: error: taking address of temporary
make: *** [wiiheadtracking.o] Error 1

May I know what cause this error?

Thanks!
Jimmy
*
Karma: +1/-0
: 8
Offline Offline
« #9 : July 05, 2010, 10:34:16 PM »

Hi,

I download your program. However I encountered an error while compiling.

+ cc wiiheadtracking.cpp
cc1plus: warnings being treated as errors
wiiheadtracking.cpp: In constructor ‘TrackWiimote::TrackWiimote()’:
wiiheadtracking.cpp:66: error: taking address of temporary
make: *** [wiiheadtracking.o] Error 1

May I know what cause this error?

Thanks!
Jimmy

Either the cwiid library had some changes, or my version of GCC didn't report the "taking address of temporary" warning. In either case, it can probably be safely ignored as a warning. Open the Makefile and remove '-Werror' from the CFLAGS line so it looks like this, then try to compile again:
Code: [Select]
CFLAGS = -g -W -Wall -Wno-unused -O2
*
Karma: +0/-0
: 2
Offline Offline
« #10 : August 13, 2010, 05:50:06 PM »

Sorry if it is a very foolish mistake, but i have an error compiling it.

It's quite long so i pasted it on paste bin, here is the link:
http://pastebin.com/6SKzypAz

Thanks!  =)

PD: I have glut, cwiid and opengl installed.
« : August 13, 2010, 05:53:43 PM pedrozs »
*
Karma: +0/-0
: 2
Offline Offline
« #11 : August 13, 2010, 06:46:19 PM »

Sorry for disturbing, i've found the answer; i had to install development versions of the packages.
: [1]
   
 
:  

Clicky Web Analytics