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 KMKxJOEY1 · Apr 14, 2014 at 12:53 AM · rotationanglenormalvector3.positionvector3.slerp

Vector3.Slerp normal

So I've started to mess around with slerping, and I understand how SLerp works where Vectors are treated as directions instead of as world positions. I have everything working the way I want it to, except I don't know how to set the normal of the Slerp. Its best to show a pic: alt text

untitled.png (282.5 kB)
Comment
Add comment · Show 3
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 akauper · Apr 14, 2014 at 12:57 AM 0
Share

We need to see the code you are using in order to help you with your problem.

avatar image robertbu · Apr 14, 2014 at 01:01 AM 0
Share

It is a bit hard to figure out what's wrong here without seeing you code and having coordinates labeled in the picture. There is no normal for Slerp, but Slerp is lazy. It takes the shortest arc between the two points.

avatar image KMKxJOEY1 · Apr 14, 2014 at 01:19 AM 0
Share

Unfortunately, there are infinite amounts of the same distance arcs between two points. Here is the Slerp invoke:

 transform.position = Vector3.Slerp(startDirection, endDirection, timePast / time) + center;

but that shouldn't really change anything. In the image, the red arc and the white arc are obviously the same distance, Unity just chooses the red one for some reason.

1 Reply

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

Answer by robertbu · Apr 14, 2014 at 01:34 AM

There are only an infinite number of same-distance arcs when the two end points are on a line that passes through the origin. That is when they are 180 degrees apart when measured from the origin. If your start position is even a fraction of a degree along the arc, then you only have one shortest arc.

Comment
Add comment · Show 3 · 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 KMKxJOEY1 · Apr 14, 2014 at 01:37 AM 0
Share

Ah I see what you are saying now, so I should basically revise the start position by a $$anonymous$$iscule amount to influence the 'normal' of the arc, thanks! If you post that comment as an answer, ill mark it as correct.

avatar image robertbu · Apr 14, 2014 at 01:43 AM 0
Share

I converted the comment to an answer. You'll want to test it first to make sure the answer solves your problem. I know it works with Quaternion.Slerp() and I believe I've tried it with Vector3.Slerp() as well. Note if it always 180 degrees between them, and if the vectors are the same length, you can just use Quaternion.AngleAxis() to rotate one vector 180 degrees ins$$anonymous$$d.

avatar image Contato · Aug 21, 2018 at 10:04 PM 0
Share

thank you, your answer was precious, i didn't know why only one of my objects had it's arch movement flipped upside down

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

23 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

Related Questions

Why does the raycast hit only objects/faces of a certain rotation? 1 Answer

local rotation per axis between frames? 1 Answer

How to use the lerp function with rotation? (C#) 1 Answer

How do I add force to an object based on my Camera's cureent Y rotation (C#) 2 Answers

rotation x changes all angles? 3 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