Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by capu087 · Feb 07, 2016 at 12:38 PM · c#rotatearoundrotations

store a rotation around a point

Hello,

I want to set the transform by affecting another temporary Transform to him because I am applying rotations (with Rotate and RotateAround on the temporary Transform). Sadly the transform is readonly and I can't do what I want.

I didn't found any way to store a rotation around a point in a Vector3, is it possible in another way ? I'm calculating all rotations and movement to do, and I am applying the combination of all at the end, so I need to store rotations around a point.

Edit, explanation: I have cubes on a roaler coaster who will guide the ship to stay on the rails (there have to be no physics)

see here: http://i.imgur.com/uUE6iN2.png

if the upper cube of the right group of cubes is triggered, and not the upper cube of the left group, I need to rotate the cubes around the group of cubes who is at the right place.

However, as I said:

In the Update,

 I'm calculating all rotations and movement to do, and I am applying the combination of all at the end, so I need to store rotations around a point.

If several cubes are triggered, I have several movements to do, and I wan't to do them all at the same time. The problem is that I didn't found any way to store a rotation around a point (in this way I have not to apply the rotation directly with a RotateAround function) I hope my explanation made you understand

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 0916dhkim · Feb 08, 2016 at 08:47 AM 0
Share

@capu I don't think I understood the question, but from your picture, (distance) = 2 radius sin(angle/2)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by capu087 · Feb 20, 2016 at 10:40 PM

i did that:

 tempMov = Vector3.zero;
 tempRot = transform.rotation.eulerAngles;
 [...]
             Transform temp = transform;
             tempRot.z += -threeSpeed * Time.deltaTime;
             temp.rotation = Quaternion.Euler(tempRot);
             Vector3 movement = transform.GetChild(1).position - temp.GetChild(1).position;
             tempMov += movement;
 [...]
 transform.rotation = Quaternion.Euler(tempRot);
 transform.position += tempMov;

it seems to work, idk if it's worth..

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.

Follow this Question

Answers Answers and Comments

85 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 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 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 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 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

Rotation towards raycast hit point, 1 Answer

How to set limitations on rotateAround in C#? 1 Answer

Move a object around another object 0 Answers

Rotate an object around one of his childs in the self space (not the world space) 0 Answers

How to rotate object through waypoints on a curved path on sphere 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