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
2
Question by VincentRodriguez · Nov 06, 2012 at 01:10 PM · mathvectorline

Draw a Vector line ???

Hi guys ! I'm wondering how to draw and control a vector line (like in Illustrator) with scripting ?

I hope you understand what I mean, and someone knows how to make it.. Thanks in advance !

Comment
Add comment · Show 2
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 Eric5h5 · Nov 06, 2012 at 04:41 PM 0
Share

Like this?

avatar image VincentRodriguez · Nov 06, 2012 at 07:26 PM 0
Share

Yes , like that

3 Replies

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

Answer by valyard · Nov 06, 2012 at 06:08 PM

If not for debug purposes drawing a vector line in Unity is not easy actually.

Debug.Line can be used for debugging, GL.Begin(GL.LINES) is ugly and you can't control lines' material nor lines' thickness.

The easiest way is Vectrosity plugin. For drawing lines with custom materials it is really good. Check out Vectrosity's docs there are script examples. You can't use it to draw lots of lines though. For this purpose you must use custom shader tricks found here.

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 Paulius-Liekis · Nov 06, 2012 at 07:29 PM 0
Share

GL.Begin(GL.LINES) allows you to control material. So if you don't need thick lines then GL lines might be better (at least from performance perspective).

avatar image Eric5h5 · Nov 06, 2012 at 07:35 PM 0
Share

Actually not, or at least it depends; GL.Lines is immediate mode, so you have to redraw it every frame, whereas Vectrosity creates a mesh, so whenever the line doesn't need updating then it doesn't need to be redrawn.

avatar image Paulius-Liekis · Nov 06, 2012 at 09:32 PM 0
Share

@Eric5h5, you're right.

avatar image
2

Answer by TK5005 · Nov 06, 2012 at 06:59 PM

I use Vectrocity from the asset store to do all my vector line work. It has a great API and is easy to get up and running with.

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
avatar image
1

Answer by Paulius-Liekis · Nov 06, 2012 at 02:29 PM

Use Debug.Line or GL.Begin(Lines) for drawing lines. For Curve math-logic I guess you will have to google it.

Comment
Add comment · Show 2 · 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 VincentRodriguez · Nov 06, 2012 at 07:28 PM 0
Share

As irgi lietuvis :D

avatar image Paulius-Liekis · Nov 06, 2012 at 09:31 PM 0
Share

:) Yra, cia biski lietuviu :)

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

14 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

Related Questions

Trying to move an object towards another's axis. 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Best way to calculate angle between series of Vector3 points 0 Answers

Finding Distance between Angles and Points 2 Answers

Vector2 Lerp. Probably a simple solution C# 4 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