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 aearm · Jan 08, 2013 at 11:58 PM · pathdrawing

How to draw an elliptical circle path for animated object?

Hi guys, I am new to unity3d world . I want to draw an elliptical circle path for my moving object My question how can I do this is there any way to generate the elliptical circle from mathematics equations and algorithms or should I create this path by 3dsmax. if you have any suggestion or any related tutorial please help

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 Screenhog · Jan 09, 2013 at 12:00 AM 0
Share

Do you want a visible path? Or do you just want an object to travel along an elliptical path?

avatar image Manco Capac · Jan 09, 2013 at 12:20 PM 0
Share

I've asked a similar question: How to make computer controlled cars? I want the road to be visible(of course), but the path'd be hidden.

The'll be moving in a more complicated way though, but the answer should be similar, so pls reply to my answer too.

avatar image aearm · Jan 09, 2013 at 09:24 PM 0
Share

I need it visible path

1 Reply

· Add your reply
  • Sort: 
avatar image
4

Answer by unimechanic · Jan 09, 2013 at 02:03 PM

You can use trigonometry to calculate the position of the object in the elliptical path, this way:

 using UnityEngine;
 using System.Collections;
 
 public class EllipticalPathCS : MonoBehaviour {
     
     public Vector3 center = new Vector3(0, 1, 0);
     public float radiusA = 5;
     public float radiusB = 10;
     public float speed = 1;
     
     private float angle;
     
     // Use this for initialization
     void Start () {
     
     }
     
     // Update is called once per frame
     void Update () {
         angle += speed * Time.deltaTime;
         
 // Calculates position with parametric form, explanation:
 // http://en.wikipedia.org/wiki/Ellipse#Parametric_form_in_canonical_position
         float x = radiusA * Mathf.Cos(angle);
         float y = radiusB * Mathf.Sin(angle);
         
         transform.position = center + new Vector3(x, 0, y);
     }
 }
 
Comment
Add comment · Show 1 · 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 aearm · Jan 09, 2013 at 09:26 PM 0
Share

I want the path be visible not only for moving object

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

11 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

Related Questions

draw a path in game with touch and move player on it 0 Answers

Generating mesh - performance issues? 5 Answers

iTween : change path in current point 4 Answers

how to generate the path or road in unity 3d 1 Answer

path of xml file 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