Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Horsepower · Mar 26, 2012 at 08:59 AM · inputgyrowiimote

Why Wiimote (or Glovepie, or Unity3D...) pull in the above-left corner ?

I made this simple script for “Glovepie” :

 **************************Joystick Virtuale - Modificato da Dario Cavallo.
 wiimote1.Led1 = true
 // Variabili (wiimote.gy non è utilizzato)
 var.xRot = Wiimote.gx
 var.yRot = Wiimote.gy
 var.zRot = Wiimote.gz
 
 debug = 'X:' + var.xRot + ', ' + 'Y:' + var.yRot + ', ' + 'Z:' + var.zRot
 
 **************************Assi Analogici Wiimote
 
        // Destra / Sinistra
        ppjoy.Analog0 = -maprange (smooth(Wiimote.gx, 5) , -1 degrees, 1 degrees, -1 , 1)
 
        // Su / Giù
        ppjoy.Analog1 = -maprange (smooth(Wiimote.gy, 5) , -1 degrees, 1 degrees, -1 , 1)
 
        // Asse-gY (Da Non utilizzare:
        // ppjoy.Analog XX = -maprange (Wiimote.gy, -90 degrees, 90 degrees, -25 , 25)
 
 **************************Assi Analogici Nunchuk
        // Su / Giù
           //ppjoy.Analog2 = -wiimote.Nunchuk.gz
        // Sinistra / Destra
           //ppjoy.Analog3 = -wiimote.Nunchuk.gx
        // POV
           //ppjoy.Analog8 = -maprange (wiimote.Nunchuk.JoyX, -90 degrees, 90 degrees, -180 , 180)
 
 **************************Assegnazione Tasti
 ppjoy1.Digital0 = wiimote1.A
 ppjoy1.Digital1 = wiimote1.B
 ppjoy1.Digital2 = wiimote1.Minus
 ppjoy1.Digital3 = wiimote1.Home
 ppjoy1.Digital4 = wiimote1.Plus
 ppjoy1.Digital5 = wiimote1.One
 ppjoy1.Digital6 = wiimote1.Two
 // Tasti Direzionali
 ppjoy1.Digital7 = wiimote1.Up
 ppjoy1.Digital8 = wiimote1.Down
 ppjoy1.Digital9 = wiimote1.Left
 ppjoy1.Digital10 = wiimote1.Right
 // Tasti Nunchuk
    //ppjoy1.Digital10 = wiimote.Nunchuk.Zbutton
    //ppjoy1.Digital11 = wiimote.Nunchuk.Cbutton
 // Wiimote speaker
    // wiimote1.Frequency = 1500
    // wiimote.volume = 5%



This works very well, with little rotational movement og Wiimote gyro, it is possible to achieve a good sensivity!

But the problem is:

1) Why Wiimote (or Glovepie, or Unity3D, I am not sure…) pull in the above-left corner of the screen?

2) In Unity3D the 3D object slide over a table fortunately, and all works correctly…

3) But why happens, this behaviour?

(...In Unity3D I added the "Slerp" function, to remove the Wiimote gyro flickering, and made some correction to the "Rotate Behaviour Script"...):

 var maxVert: float = 90; // define the max vertical angle (to each side)
 var maxHor: float = 90;  // define the max horizontal angle (to each side)
 private var initRot: Quaternion;
 
 function Start(){
   initRot = transform.rotation;
 }
 
 function Update(){
   var angV = Input.GetAxis("Vertical") * maxVert;
   var angH = Input.GetAxis("Horizontal") * maxHor;
   var target  = initRot * Quaternion.Euler(-angV, 0, angH);
   // Dampen towards the target rotation
   transform.rotation = Quaternion.Slerp(transform.rotation, target,
                          Time.deltaTime * 1);;
 }

Please, hurry, response me!

It’s urgent!

Thanks you!

Horsepower.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Horsepower · Mar 28, 2012 at 08:12 AM 0
Share

Hurry! Please, help me! It's urgent!

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Android - Input.gyro.attitude not working 1 Answer

Gyro calibration in android? 0 Answers

Unity 3.4 Gyroscope support not there? 2 Answers

What is with Input.Gyro.UpdateInterval? 1 Answer

Does exists a solution to remove flickering of the Wiimote gyro ? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges