• 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 TheGodEmperor · Jan 30, 2012 at 10:00 PM · quaternionstransformsconverting

Converting Transforms To Quaternions

Hey,

I've been trying to figure out how to convert transform information into quaternions as it would make some network traffic for a game my group and I are working on a little lighter and the lighter we can make the network traffic, the better. I know that the transform is made up of vector3s that represent the position and there's already a quaternion for the rotation. So it makes me wonder if one can change the transform to a quaternion and maintain the data or what kinda thing would be lost? I know that quaternions are mostly used for rotational stuff from what I've read, but I was just hoping we can make some lighter network calls.

Thanks in advance for your help!

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 Eric5h5 · Jan 30, 2012 at 11:05 PM 0
Share

A Vector3 is smaller than a quaternion, so I'm not sure why you'd want to try converting position to a quaternion, if that's what you're asking.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by DaveA · Jan 30, 2012 at 10:09 PM

Someone will correct me, but a 'transform' is generally a 3x3, 4x3, or 4x4 array of numbers (float) which taken together in an linear-algebra way represent position, rotation, scale, and possibly skew. So if you just want to transmit rotation, you could do that with the transform.rotation. If you want 3 floats instead of 4, you could use Euler angles, but you might have some loss due to ambiguity when reconstructing it on the receiver (but it may depend on your particular needs). In any case, you've tossed scale and position out by 'converting to quaternion'. If scale is not important, but position is, send position and rotation. Only if you needed position, scale, and rotation would I consider sending the whole transform.

Comment
Add comment · Share
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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Convert local rotation animation data to a hierarchy with different orientation 0 Answers

How can I create a grid of transforms? 3 Answers

Gaps and overlaps between platforms in the infinite runner 0 Answers

Converting string to int or float got FormatException error 1 Answer

Converting Code Problem 1 Answer


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