I hope its ok to share this, the original link seems to be gone.
The attached zip includes aDarwiinRemote that outputs the xyz values of the accelerometers to a textfile, which unity can read every update.
This script reads the file and changes the rotation of a gameObject every frame.
import System;
import System.IO;
var calY = 100;
var calX = -100;
var values : Array;
var smooth = 20;
function Update () {
var coordinates = "/wiimote.txt";
if (File.Exists(coordinates)){
var sr = new StreamReader(coordinates);
var txt = sr.ReadToEnd();
values = txt.ToString().Split(";"[0]);
}
accX = int.Parse(values[0]);
accY = int.Parse(values[1]);
accZ = int.Parse(values[2]);
target = Quaternion.Euler (calY-accY*3, 0, 0);
transform.rotation = Quaternion.Slerp (transform.rotation, target, Time.deltaTime*smooth);
Debug.Log(values);
}
JarwiinRemote.zip also includes a processing script.
downloaded your zip file and am confused as it seems to have nothing in it but darwiin remote which I already have, am I missing something? Really keen to start developing something with the response of the wiimote.
Okay, apologies guys, I simply hadnt deleted the profile in my bluetooth devices from when I used the original Darwiin software - ive deleted, run the modded version and it works now, sorry to rant!
I can get regular DarwinWiimote to work just great on my mac, but when I try the modded version, the program just crashes when I connect my wiimote. I’ve made sure to delete the wiimote from the bluetooth thing in the top right.
I’m really not sure how this is supposed to work. The app is just an old version of Darwiinremote, no? Where does it output the file to? I’d like to use the nunchuck too, and this version of darwiinremote doesn’t support the nunchuck.
Is it possible to make the new version of darwiinremote save to a textfile continuously, so I could use the nunchuck?
i’m really curious as well… ! if anyone has hints on how to get the wii to integrate with unity INDIE, i’d be grateful… i’ve tried both uniWII and DarwiinRemote
I guess this is for wiimotes connected to PCs/MAC. What about Unity Wii wiimote control? Is there any way to access to the variables like rotation, acceleration and so on? Any idea about this?