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 Banister88 · Jul 29, 2012 at 02:07 AM · rotationquaternionoffsetgyro

Quaternion partial offset, need help badly

I previously had a question about a quaternion offset that was answered here: http://answers.unity3d.com/questions/289184/gyro-quaternion-offset.html. So I have a initial position that I want to rotate to, and I rotate to it with a tween. I'm currently adjusting my iPad screen to look where the gyro is looking around a 3d scene, so after it rotates to this initial location I use the fix found in the link above: in Start() I do

initialRotation = transform.rotation; gyroInitialRotation = Input.gyro.attitude;

and in Update():

Quaternioun offsetRotation = Quaternion.Inverse(gyroInitialRotation) * Input.gyro.attitude; transform.rotation = initialRotation * offsetRotation;

This works great, except I'm finding that a lot of users tip the iPad down when they're looking at this app. So what happens is that when it is tilted like that they are looking perfectly out the window, but then they readjust and they hold it straight and look to the side. This causes the door to be at an angle since it thinks that looking perfectly straight was at this slight tilt.

So I want to offset to the initial rotation of a predetermined rotation, but not in a certain axis. Specially, they are rotated into the car with the iPad titled, all of the rotation is offset correctly except for tilt away/towards rotation. So if they are slightly titled they will be looking at the dash, or the radio, or whatever degree of tilt they're currently using, but they're facing the right direction. That way when they hold it straight up and down and look around, nothing will be on an angle. If anyone has any suggestions or help, I'd greatly, greatly appreciate it.

Thanks.

Comment
Add comment · Show 5
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 Banister88 · Jul 29, 2012 at 04:16 PM 0
Share

Or is there another solution to the problem that someone sees?

avatar image Banister88 · Jul 30, 2012 at 12:35 PM 0
Share

Anybody at all

avatar image whydoidoit · Jul 30, 2012 at 12:41 PM 0
Share

So this is quite hard to get your head around :) Are you saying you want the rotation around the X axis to be ignored in the initialization phase? Or always?

avatar image Banister88 · Jul 30, 2012 at 01:25 PM 0
Share

I would like it so that ins$$anonymous$$d of offsetting perfectly to the point that I have defined (the looking out the windshield one) that it ins$$anonymous$$d looks in the direction of the windshield (so all but 1 of the axis) and ignores the tilt down. From there I'd want to be able to look around the scene using the gyro as I can now. with the above code.

avatar image whydoidoit · Jul 30, 2012 at 01:42 PM 0
Share

And is that represented by the X axis tilt of the device (it feels to me like that is the one that is looking up or down)? If so can you not just get the Quaternion, use the euler angles and reset that (gimbal lock might be a problem I guess).

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

3D camera relatively using gyro a la N.O.V.A. 2 0 Answers

smooth look at with offset 0 Answers

Mimic other object's rotation on one axis (with offset) 0 Answers

Limit Rotation of Camera around a player using keyboard 1 Answer

Turning a vector into a local offset? Math help 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