Author Topic: Pitch and Yaw in stationary position coding help with motionplus  (Read 8313 times)

Offline antmorton

  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Hi guys

I think I posted this in the wrong forum so I'll re-post it here!

I'm in my final year at uni and am doing an interactive sound piece using the wii remote as kind of a head tracker. I only need the pitch and yaw in a single point. The user will be stood still with a wii remote with the motion plus attached to a pair of headphones. The values are then converted to midi which controls a specific VST plugin I have made.

The problem I am having is that my yaw 0 point is always changing. It starts at 0 fine, but sometimes it starts to increase without any movement. With a few minutes of rotational movement it's 0 point changes to a different direction/angle. I need the centre point to remain in the same place.

Also my pitch is jumping quite a lot although seams to work and its centre point always remains the same when the remote is laid flat.

I'm not a very competent coder and thus really need some help please!


This is the simple code I'm using:

//
var.Yaw = Wiimote.Yaw
var.Pitch = Wiimote.Pitch


midi2.Control30= (EnsureMapRange(var.Pitch, 90,-90, 0,1))
midi2.Control31= (EnsureMapRange(var.Yaw, -45,225, 0,1.5))

//


Extremely basic I know, but like I said, I aint very good at code!!


The ranges are for compatibility with my plugin, that's why it may seam a bit wierd at first glance!



Offline JayAr

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile

This is the simple code I'm using:

//
var.Yaw = Wiimote.Yaw
var.Pitch = Wiimote.Pitch


midi2.Control30= (EnsureMapRange(var.Pitch, 90,-90, 0,1))
midi2.Control31= (EnsureMapRange(var.Yaw, -45,225, 0,1.5))

//


Seems like you get the Yaw and Pitch not from Motion Plus but from the Wiimote...
Are you using Glovepie?
I think it should be something like:

Wiimote.MotionPlus.Yawspeed
Wiimote.MotionPlus.PitchSpeed

or Wiimote.MotionPlus.GyroYaw ...