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 /
avatar image
0
Question by DayyanSisson · Sep 28, 2015 at 06:38 AM · line rendererarcformulaparabola

LineRenderer: 2D Parabola in 3D Space

Hey all,

I've been working on creating a program that can create a 2D parabola in 3D space (for arcs, and such) but am having some trouble with the third dimension. I've been using this code to generate the parabola:

 int i = 0;
 while (i < accuracy) {
     float z = interval * i;
     float y = ((a * (z * z)) + (b * z) + c);
     Vector3 position = new Vector3(x * i, y, z + arcCaster.position.z);
     arc.Add(position);
     i++;
 }

...where z is a public float and a, b, and c, can be found by:

 a = power;
 b = power * h * -2;
 c = (power * (h * h)) + maxHeight;


All this is based on the vertex form of the quadratic equation:

 a(x-h)^2 + k 

or

 power(x–HValue())^2 + maxHeight
 
 float HValue () {
 
     return Mathf.Sqrt ((arcCaster.position.y - maxHeight) / (1/-power));
 }

Now this gives me a nice arc:

alt text

But I cannot rotate this arc. It needs to be able to point in the direction of the cube. My initial thought was to put the positions in a line renderer, set it to local space, and then make the line renderer a child of the cube. But then I realized that I needed those positions for other things, and the positions of the line renderer were in local, not world space.

If I could get the positions of the line renderer and then convert it to world space that would be great. But looking around it doesn't seem like that's possible. Any solutions to this?

screen-shot-2015-09-25-at-72531-pm.png (356.4 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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by conceptfac · Aug 25, 2020 at 04:51 AM

I have the same issue

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

28 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

Related Questions

How to have player fire projectile in a parabola? 4 Answers

position coins in parabolic path 1 Answer

Triying to make a character take knockback in a parabolic motion in 2D. 0 Answers

How to shrink a line renderer 1 Answer

How to put a gameobject at the position of the line formed by a LineRenderer? 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