Here is a project that we did at Entertainment Technology Center (ETC) at CMU.
Description:
Crayon3D is a project at ETC that aims to create a new platform for the BVW class. Part of the goal is to provide an interface to use Wiimotes as an input device in Panda3D. In addition to this, Crayon3D also provides a simple interface to ODE for simple physics simulations and collision handling.
Our focus for this project is to use the Wiimote’s IR camera for tracking infrared points for finger tracking and fish tank VR (similar to Johnny Lee’s head tracking).
Please visit our website for more information. crayon3d.org
Features:
Full integration with the Wiiuse Library
-Support for:
- Accessing wiimote data (buttons, accelerometer, IR camera)
- Accessing wiimote expansion devices (nunchuk, classic controller, guitar hero 3 controller)
Includes helper classes for:
Controlling and managing wiimote resources
IR Point tracking as a cursor (for finger tracking)
IR Point tracking for Fish Tank VR
Gesture Recognition
Simple interface to the ODE library
Well-documented source code
API Reference
Expandable
Version 1.0.0 is now available and can be downloaded from http://www.crayon3d.org. The package includes a How-To Presentation, an API Reference, a sample code, Crayon3D source and DLLs.
just the Wiimote interface is a feature that make me scream but sadly it seems so a closed project and for windows only.
The idea is awesome nonetheless.
same question here, where’s the linux/mac version ?
wiiuse library is opensource(gpl3), it runs on windows and linux (macport seems not to be maintained since noone there owns a mac)
the crayon thing seems to use ctypes so… i dont really see a real reason why one could call it “closed” , aside from… i don’t see a license anywhere at all??
well from what i can see it would be possible to make it run on linux and mac with some effort.
on a second thought (and watching closer the package files) I were half wrong and you got half right Tomas, half package is indeed open (pure python) but the real deal is indeed the Wiimote thing and we linux-ers are unable to try it out just because are compiled .dlls, therefore ‘closed’.
Ah, I didn’t notice the second download on the download page, after scrolling down.
So, I downloaded and compiled wiiuse, and installed it into my system.
Then I downloaded the wiiuse_al library from the Crayon download site.
The code wouldn’t compile for a few reasons:
Linux knows no __declspec, I just put "#define EXPORT " there.
Got this error with compiling:
wiiuse_al.c: In function ‘get_ir_sensitivity’:
wiiuse_al.c:644: error: ‘wm’ undeclared (first use in this function)
wiiuse_al.c:644: error: (Each undeclared identifier is reported only once
wiiuse_al.c:644: error: for each function it appears in.)
I didn’t bother to further investigate so I just commented out the function definition and declaration.
Hmm… this is weird. I was just calling a macro here and wm is one of the macro’s parameters.
Not sure about this one but I think Linux doesn’t have __declspec. I’ll try to investigate these further after I revive my old Linux box.
As I said, we haven’t really tried to run this in Linux since all of the workstations used for BVW are windows. Any help on this will be greatly appreciated.
#define WIIUSE_GET_IR_SENSITIVITY(dev, lvl) \
do { \
if ((wm->state & 0x0200) == 0x0200) *lvl = 1; \
else if ((wm->state & 0x0400) == 0x0400) *lvl = 2; \
else if ((wm->state & 0x0800) == 0x0800) *lvl = 3; \
else if ((wm->state & 0x1000) == 0x1000) *lvl = 4; \
else if ((wm->state & 0x2000) == 0x2000) *lvl = 5; \
else *lvl = 0; \
} while (0)
This seems to be a typo in the wiiuse library, the parameter is called “dev” while the variable used is “wm”. I’ve contacted the wiiuse developer about this bug.
It might be a good idea to redefine this correctly in the wiiuse_al library.
I’ve been told that on Linux, everything is exported by default, and __declspec(dllexport) is not needed.
The __declspec syntax is a Windows-only syntax for marking symbols for export from a dynamic library. Since this is the default behavior on Linux and on every other system in the world, simply omitting the syntax is the correct thing to do for Linux. (You would use the attribute syntax only if you enabled certain obscure compiler settings that made this necessary.)
Incidentally, this is the purpose of the EXPCL_PANDA etc. symbols in front of almost every class name in the Panda source code. This macro is defined to map to __declspec on Windows, and nothing at all everywhere else.
I’ve found what I was doing wrong - I accidentally compiled with g++ instead of gcc, resulting in different symbol names.
I recommend putting this around the function declarations in wiiuse_al.h: