Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 PrimalAce · Aug 16, 2013 at 01:18 PM · rigidbodyaddforceforcecalculationscenterofmass

Calculate forces required to rotate around an arbitrary point regardless of center of mass position

I have an object (a cube) with a center of mass offset from the transforms center. If I apply forces in front and behind the cube to induce a spin on the object it will rotate around the center of mass rather than the center position of the transform as it should. Imagine holding a pencil between two fingers and pushing each end in opposite directions so the pencil spins in place.

However I would like to know if it's possible to calculate the forces such that without changing the position they act on they can provide different amounts of force to cause the object to rotate around the transforms center and not the center of mass. Basically I want to counter the uneven distribution of mass so that it appears to rotate around its center. Common sense is telling me this should be possible by applying a greater force on the end closest to the center of mass but I could be way off here. Any help with this would be greatly appreciated.

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 zombience · Aug 16, 2013 at 03:59 PM 0
Share

What you're asking is absolutely doable, but requires an intimate knowledge of physics equations, force, mass, acceleration, and how to calculate all those in a rotating system.

If physics isn't your thing, that's going to be really hard and I suspect will bog your project down for a long time while you figure that out.

If you truly want to do that, go study physics. I occasionally get caught up in these side ventures because I love learning things like that, but it's non-trivial and may take weeks, depending on the complexity of the problem you're trying to understand and your experience level. And, as I said, if math or physics is not your thing, this could be hard.

An alternate solution would be just to fake it, and make two models which have different centers of mass, and perhaps interpolate values between their two positions and create a third cube that approximates the desired difference between rotating around the center of mass, and rotating around the geometric center.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Owen-Reynolds · Aug 16, 2013 at 07:22 PM

I'd think it's not doable for two reasons: how the program works, and how real physics works.

In practice, it seems easier just to temporarily change the CenterOfMass yourself (very easy to do in code.) Alternately, have code put a temporary hinge joint at the "spin around" spot (attached to just nothing -- counts as being glued to "the scene".)

Coding, I believe that angularVelocity is applied as a spin around the center of mass. So any combination of shoves will result in a straight-line velocity with a spin around the CoM (in the pencil example, the velocities cancel, leaving only the spin, which is the point.)

In real physics, I think the same math appiles. The centerOfMass is the single point the object "counts as being." Like how you can treat the entire earth as being at the center of the planet for gravity. Spinning around the CoM is like being stationary. Spinning around not-the-CoM is like moving in a circle while also spinning at the same rate (so that some non-CoM point isn't moving.) An object isn't naturally going to move in a circle unless something forces it to -- a spinning top has the friction of the tip on the table to do that. There's also some gyroscope effect(?) which I'm 99% sure PhyX doesn't handle.

In other words, clamp a heavy paper clip near the end of a plastic straw and try to spin it around the center. I think it can't be done, and any attempt will simply use the torque to launch the paper-clip like a catapult (dragging the spinning straw with it.)

Comment
Add comment · Show 2 · 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
avatar image zombience · Aug 16, 2013 at 07:28 PM 0
Share

good points. in my answer, i was more addressing what i believed he wanted to appear to be happening, rather than the actual data of what would happen.

avatar image PrimalAce · Aug 17, 2013 at 05:31 PM 0
Share

Thank you for your considered responses and I believe you are right. I think what I was really after without fully realising it yet was a solution for the thrust allocation problem. This problem is a really big deal in real life for sea going vessels trying to move in a desired way with a set amount of manoeuvring jets located around it. It's also a very hard problem to solve and I'm not nearly smart enough to give it a go. For now I will just leave the distribution of mass up to the player to balance. If they don't then it wont rotate around the centre and it'll be less efficient as a result.

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

17 People are following this question.

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

Related Questions

Ball Rotating Help 0 Answers

About Forces and Time.deltaTime 3 Answers

Add Force without Rotation 2 Answers

AddForce not influenced by rotation 1 Answer

[Solved]Why doesn't this Rigidbody.AddForce work the way I tell it to? 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