Author Topic: Modified Wiimote Desktop VR  (Read 16773 times)

Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
on: March 16, 2008, 03:28:52 PM
1st off... Hi and welcome to myself...UndCon - from Sweden...

I've been watching this project for quite some time and I finally purchased a Wiimote myself...

Connected without any problems I fired up WiiDesktop and played around (like any normally interested geek)

As I'm into C# programming I also Opened the project in Visual Studio2008 (project upgraded to latest technology without any problems)

I study the code for an hour or so and start hacking about...

Now I have moved lots of the variables into config.dat in order to make the application more userfriendly...

Now my config contains a few more alternatives:

screenHieght(mm):229
sensorBarWidth(mm):100
screenAspect(width/height):0
cameraIsAboveScreen(true/false):False
connectToSecondWiimote(true/false):False
fogEnabled(true/false):False
showGrid(true/false):True
showLines(true/false):False
showTargets(true/false):False
showBackground(true/false):True
fullScreen(true/false):False
numTargets(INT)10
numInFront(INT)3


Here you see that I now can set fog, grid, lines, targets and their positions and numbers, background & fullscreen by startup - easily done by modifying the config.dat values from True to False...

I also added (F) key bound to Fog...

I'm currently working on the colors...

lineColor, gridColor and fogColor is next to go...
(they will be bound to keys as well and I'll probably add a colorArray that can be used by all 3 new keys, like tapping a button will move to the next color in the colorArray...

Next on my ToDo-list is a folder for backgrounds where you can store any .PNG image you want...
A separate function to read files in a specified dir will be used for the Target as well...

A function "readDir" gets a parameter so you can call it to read both the "backgrounds" folder and the "targets" folder and it replies kindly with an array of image-names that can be changed by keystroke

And I'll probably add keys to change values for: numGridLines, boxdepth, fogDepth...and more?

(why not)

So I did some changes...improvements or bloats - It's all up to the user to decide...

When I'm finished or at least happy enough I'll release the code on a page dedicated to my Wiimote...

So you have some useful input or just want to give me a comment - bring it on ;)

Best Regards - UndCon
« Last Edit: March 16, 2008, 03:51:00 PM by UndCon »



Offline tillydevine

  • *
  • Posts: 22
  • Karma: +0/-1
    • View Profile
Reply #1 on: March 16, 2008, 09:20:30 PM
THANK YOU!! So much for changing (tweaking) the code a bit. Are you able to change it so we can have different 'target' pictures on the screen at once? Instead the one picture multiplied over and over. I would like to have a picture of a person at the front and another person behind that one etc..

Once again THANK YOU and I cant wait for the code!!!


You have a fan.



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #2 on: March 17, 2008, 01:07:16 AM
Thx tillydevine!

Of course we can alter the program to read several images for the targets.

If you want your images to appear in a specific order I think you have to name them alfabetically in that order or in a numerical way like 01, 02, 03 ...


Thank you for this idea - Ill try to implement in later so I add this feature to the ToDo-list



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #3 on: March 17, 2008, 05:40:11 PM
UPDATE! - day2

here is what it looks like atm...




check out the menu under Extras-----

here is a config.dat

screenHieght(mm):229
sensorBarWidth(mm):100
screenAspect(width/height):0
cameraIsAboveScreen(true/false):False
connectToSecondWiimote(true/false):False
fogEnabled(true/false):False
fogdepth(float):2
numGridlines(Integer):8
boxdepth(float):8
showTargets(true/false):True
showLines(true/false):False
showBackground(true/false):False
backgroundStepCount(Integer):15
doFullscreen(true/false):False
numTargets(Integer):10
numInFront(Integer):3
maxTargets(Integer):10
showGrid(true/false):True


As you see I'm now using many keys to control variables (but not all of them - some requires manually editing in config.dat)

So far no colors or background-gallery...I had to start all over today as my build got corrupt..(directX crashed)

I had some troubles with the colors in Hex values - as they all comes as strings from config.dat. The value has to be parsed and I tried in 4 different ways with no luck... (I dont want to write an entire parsing class for this) - I'll try to use the "System.Color.Yellow" -aproach instead and parse from a known color into hex... - besides, the "Yellow" (textversion) is in use 1 time already...

more work to be done... now my batteries in Wiimote are all empty :D

Cheers - UndCon
« Last Edit: March 19, 2008, 01:21:47 AM by UndCon »



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #4 on: March 19, 2008, 01:20:44 AM
UPDATE! day 2.5

A few more Items relocated to config.dat

showHelp(true/false):True
showMouseCursor(true/false):False
m_dwWidth(Integer):1024
m_dwHeight(Integer):768
lineDepth(Integer):-200


Optional by startup is the way to go..but linedepth seemed not working...I'll have to check it out more after work...


Keep up - UndCon



Offline Iceman1979

  • *
  • Posts: 40
  • Karma: +1/-0
    • View Profile
Reply #5 on: March 19, 2008, 09:51:37 AM
Looks good. Keep up the good work.



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #6 on: March 19, 2008, 12:26:58 PM
Thx Iceman1979...

I also tested a webpage that writes the config.dat for you with all settings you specify (or some defaults)

along with this goes some explanations to each setting...



Offline tillydevine

  • *
  • Posts: 22
  • Karma: +0/-1
    • View Profile
Reply #7 on: March 19, 2008, 08:51:41 PM
I love your work. Any chance of placing 3d models instead of bitmaps? Or am I asking a little too much?

Thank you and keep going well.



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #8 on: March 20, 2008, 03:28:14 AM
If you want to go with real 3dmodels you should use Papervision (create flash3d) and view in browser instead.

With Papervision it is really easy to use 3dmodels in .DAE format...

Of course you can use 3dmodels with directX but then we are more into game programming - and I'm afraid that is outside of my knowledge...


EDIT:

my source as it is so far can be found here:
http://undcon.com/mods/wiimote/wiidesktopvr.zip

(with all changes mentioned above)
« Last Edit: April 28, 2008, 04:18:36 PM by UndCon »



Offline BUD

  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Reply #9 on: May 20, 2008, 01:52:57 PM
Hi,

is it possible to modify the program to provide a certain user-choosen
key if the head moves for a predefined distance out of the center?
Maybe "k" if the head moved more than 10cm to the left and "l" for right?

I think itīs probably very easy but with my knowledge of programming itīs
almost impossible for me  :-[

BUD



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #10 on: May 21, 2008, 12:28:10 AM
Of course you can add movements by buttons instead of by mouse - but I don't understand why you want to do so ?


It involves making a function that takes the current position and adding or substracting 10 units when you press a specific button

And of course you have to add the code to register the press of the keys - but that can be copied/pasted and shoud work with minor tweaks (ie changing key to bind)

And of course writing it on the screen as the yellow text appears today (easily done)


I can have a go at this tonight if you really want it implemented (I'm off to work now 0730 (GMT+1)



Offline BUD

  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Reply #11 on: May 21, 2008, 09:59:48 AM
My bad english strikes again  :D

What I was trying to say:

While playing a fps-shooter for example, you have to crouch, lean and strafe around a corner.
The whole crouching and strafing isnīt the problem, but i have "limited" fingers so all tree buttons
are impossible to reach for me.

And here my idea orignated:  leaning head right (for a certain amount) => bind key "X"
                                                leaning head left  (         "          ) => bind key "Y"

So i would just have to run the application in the background, and achieve full control over my avatar.


I hope my simpleminded, onedimensional wish isnīt too unsettling  :P



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #12 on: May 21, 2008, 11:09:45 AM
OK - I understand - but it is a bit out of my league i think



Offline cnathan

  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Reply #13 on: November 21, 2008, 09:31:17 AM
Hey UndCon,
It looks like your pretty savy with the C# language, and you seem to know a thing or two about WiiDesktopVR. I was wondering if you could help me out.. I have been faced with this project for a little while now, what I am trying to do is extract the Est Head X-Y coordinates that you see in display from the program while it is running and stream them into a text file, giving me the ability to monitor movement. Would you have any idea how I could do this or how I could get started? Any input at all would most like be a HUGE help!



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #14 on: November 21, 2008, 04:49:41 PM
Hello!

I haven't messed with this for a while and I have all code at work so Ill have to look into that...


//UndCon