• 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 MitchellKrenz · Aug 31, 2019 at 10:33 PM · 3d models

How to rotate a plane around a set of 3D points forever?

I am trying to reproduce a recreational math puzzle that was moddled in 2D on the youtube channel 3 Blue 1 Brown. The link can be found here.

I want to test if this workss in 3 dimensions using a plane instead of a line. So what i need to figure out to get started is how to have say 3 points in 3D space and a plane which starts centered on one of the points. So far I have this working. I was able to reproduce the 2D example in 3D space (all points have y pos = 1) using the following code:

 // Start is called before the first frame update
     void Start()
     {
         GameObject startingSphere = GameObject.Find("Sphere004");
         this.transform.position = startingSphere.transform.position;
         this.transform.Rotate(startingSphere.transform.position, 90);
 
     }
 
     // Update is called once per frame
     void Update()
     {
         this.transform.Rotate(0, .75f, 0);
     }
 
     private void OnTriggerEnter(Collider col)
     {
         this.transform.position = col.gameObject.transform.position;
     }

alt text

The plane has its rotation updated every frame and bounces around between the points exactly as it should. Because I am using triggers for the collisions the physics engine is not being applied at all.

Now I want to move the points so they are not all on y = 1 and have the plane rotate on all 3 axis. What I am first wondering is if I should not be using triggers and somehow just give the plane an arbitrary initial rotation and somehow have it keep going without slowing down. OR If i should be using triggers still and somehow calculating the normal of the plane and the point it is colliding with and then after updating the location of the plane to be centered on the new point, also updating its rotation to the new values, but i dont know how i would determine this.

I think the second answer is the right one, but im barely a beginner with Unity and my linear algebra is a bit rusty also.

Any help would be greatly appreciated!

Thanks!

windmill.png (91.1 kB)
Comment
Add comment
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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

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

Unity won't recognize fbx file 1 Answer

3d model problem 1 Answer

Is there an optimal amount of seams on a 3d model / character? 0 Answers

I want to make AR 3D object TwoFingerTilt 0 Answers

Unity3D player moveforward stutter,Unity3D player stutter while doing running animation 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges