Controller tracking in an VR enviroment.

Josh Gledhill's icon

Hey,

I am currently in the process of building a VR enviroment with a number of patches which I have hacked together to work.
My problem is there anyway of added a shape such as a cube to track the movement of my wiimotes (one in left and one in right). So the user can see the wii motes movement within the VR world a bit like the HTC VIVE stuff? Any help would be great I will attach the patch below and a photo example of what the HTC vive VR view is :)

Sorry it's a messy patch :(

Thanks

Josh
JoshGledhill.co.uk

VR-ENVIROMENT-MINUS-THE-VR.maxpat
Max Patch
HTCVIVEVRCONTROLLERS.jpg
jpg
Graham Wakefield's icon

Not quite sure what you're asking, but if you do have an HTC vive then pretty soon you'll be able to use the [htcvive] object (right now it renders but the controller tracking is still a TODO item). https://github.com/worldmaking/Max_Worldmaking_Package

You can add whatever jit.gl.* shape you want, all you need is the proper position & orientation (quat) to send to it. And that means getting your wii position/orientation relative to the origin in physical space (e.g. the center of the interaction area of the HTC Vive, or 1m in front of the camera for the Oculus Rift). A [jit.anim.node] can serve to do the transform between the wii-space and the VR-space, but you will need to find a way to calibrate the relevant position/quat of this jit.anim.node. It might be possible to do it manually -- place the two wii's somewhat well-spaced, and then jiggle the transform until they feel like the right place in the virtual world -- but it will take some time to get it really tight, especially if there are rotations involved!

Josh Gledhill's icon

Thanks, have you got a patch to show me how to do the tracking with the Wiimote? I am not quite understanding the patching routing.

Thanks again

Josh

www.joshgledhill.co.uk

kcoul's icon

Just curious what your final goal is for the project. If you are producing an interactive space you can see through a window on a regular computer monitor, it'll be much simpler than if you intend to bring the project into actual VR with a head mounted display, closer to what the wiimote was originally intended for.

Are you working with any of the wiimote objects for Max currently, like aka.wiimote (Mac), ajh.wiimote (Mac) or tk.wii (Win)?

If you are not going to do actual VR and just want to wire up the wiimotes to control your cubes in a VR-like world, you'll just need to do some offsets for the position info coming off the wiimote object's IR output to the X and Y position of the cubes you want to control.

Keep in mind that wiimotes never did positional control along the Z axis and so you're never going to get something like the HTC vive wands or Kinect if you do want to bring your patch into full VR.