- Home /
Use Iphone as sterring wheel
Hello,
My problem is simple.
Imagine you are playing a car video game and you want to use the phone itself as a steering wheel. I have seen this kind of thing many times.
I found this very good resource : http://forum.unity3d.com/threads/98828-sharing-gyroscope-controlled-camera-on-iPhone-4
but I am getting a bit mixed up with the mysterious quaternion rotation. However now, I just want to get one axis rotation from the iPhone Gyroscope(Quaternion) and apply it to the Y axis of my car. I have been searching ways to convert the gyro data (quaternion) to vector3. Euler...No joy!
I
Answer by Max-Dep · Jul 18, 2012 at 07:42 AM
unfortunately this one takes a Euler input and converts to quaternion...from what I understand I am looking for the opposite. something that would look like this.
var ObjectRotate : Vector3 = QuaternionToEuler(Input.Gyroscope);
Function QuaternionToEuler() {
}
...but of course I need to fill in the function.
On the other had I find quite stupid to convert a quaternion to Euler so Unity converts it again to Quaternion(since that how it works). So I am open to any other more elegant solution
Your answer
Follow this Question
Related Questions
Raycasting at an offset angle? 4 Answers
How do you manually override mecanim's interpolation with rotations? 2 Answers
Comparing quaternion values and extracting values from quaternions 0 Answers
iTween(JS version) could not be used in Unity iPhone? 3 Answers
Unity iPhone 2D Left Right movement 0 Answers