Welcome! Log In Create A New Profile

Advanced

Nunchuk Programming

Posted by Arikado 
Re: Nunchuk Programming
September 05, 2008 03:22PM
I know this isn't entirely on topic, but didn't deserve a topic of it's own in my opinion. Can someone tell me what rumble is? I don't have a wii so I don't know these things.
Re: Nunchuk Programming
September 05, 2008 07:16PM
There's a small motor inside the Wii remote that can make it vibrate. Ever used a Playstation 1 or 2 controller and felt it shake a bit when you got hit in the game? The Wii remote can do that too.
Re: Nunchuk Programming
September 05, 2008 09:29PM
I used the rumbling with a timer that has it rumble for about half a second. It will be in the next release of Wii Shooting Gallery.

EDIT: And, erm, by the way WiiPhlex you could have just posted this in the Wiimote Rumbling topic.



Edited 1 time(s). Last edit at 09/05/2008 09:31PM by Arikado.
Re: Nunchuk Programming
September 06, 2008 01:48AM
Did not see it sorry, thanks, I thought it was that, just wasn't sure.
Re: Nunchuk Programming
July 28, 2009 01:55PM
My first wii game is another clone of the old Activision game Kaboom. I want to use the x axis of the nunchuk for movement. I tried using the wiimote's ir, but it is just not responsive enough. Ideally, if the nunchuk joystick is moved to the far left, the barrel would move to the far left (x coordinate 0).

Anyone have any ideas on a way to convert data.nunchuk.js.pos.x to a screen x value?

I'm assuming the range of values for data.js.pos.x is different than the screen x coordinate range. I haven't had a chance to confirm that.
Re: Nunchuk Programming
July 29, 2009 11:07AM
Quote
scarter11
Anyone have any ideas on a way to convert data.nunchuk.js.pos.x to a screen x value?

I'm assuming the range of values for data.js.pos.x is different than the screen x coordinate range. I haven't had a chance to confirm that.
Assuming that js is data.nunchuk.js:
screen_x=(js.pos.x-js.min.x)*screen_w/(js.max.x-js.min.x)
and same for y:
screen_y=(js.pos.y-js.min.y)*screen_h/(js.max.y-js.min.y)
screen_w and screen_h are usually 640 and 480.

I'm gonna explain myself a bit: range of values that nunchuck gives are between js.max and js.min. So their subtraction js.max-js.min tells the "width"/"height" of nunchuck movement.
So when we divide screen width with nunchuk "width" we get the number that translates nunchuk coordinate to screen coordinate by multiplying. Then we just have to multiply js.pos.x with that number. However we have to subtract js.min.x from js.pos.x to map the position to start from 0 to nunchuk "width"

I don't know if you can understand very well what I'm writing because I'm not native english speaker :)
Re: Nunchuk Programming
July 29, 2009 01:52PM
That makes sense. When I got home last night I used ArielX's example code to display what the min and max values were: for my unit it was roughly -100 to 100. I didn't even notice the min and max values in the struct. I came up with a rough formula that was fairly close.

In my testing, I didn't really like the response of the controller when mapping joystick position to screen coordinates. I may try using a proportional velocity instead and see how that feels.

Thanks for the help.
Sorry, only registered users may post in this forum.

Click here to login