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
3
Question by gusfai · May 02, 2012 at 07:31 PM · circlevectrositycontinuous

Vectrosity - Problem with MakeCircle

Hello,

I'm trying to draw an octagon. This is my code:

 poligono = new VectorLine("Poligono", linePoints, Color.yellow, null, 2,LineType.Continuous);
 poligono.MakeCircle(new Vector2(200, 200), 130, 8, 0);
 poligono.Draw();


The octagon is drawn BUT it also makes a line from the last point to (0,0) (left lower corner of the screen space).

I can only avoid this by changing the line type to discrete, or by adding this right before the Drwaw() call:

 linePoints[9] = linePoints[8];

In this way I erase the extra point by yuxtaposing it to the previous one.

What's the correct way to draw an octagon without this extra line, while using "continuous"?

thanks, Gustavo

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
6
Best Answer

Answer by Eric5h5 · May 02, 2012 at 07:40 PM

 var linePoints = new Vector2[9];
 poligono = new VectorLine("Poligono", linePoints, Color.yellow, null, 2,LineType.Continuous);
 poligono.MakeCircle(new Vector2(200, 200), 130, 8, 0);
 poligono.Draw();

Remember that continuous lines need point arrays that are 1 more than the number of segments. Since they are continuous and draw from one point to another. If linePoints has more than 9 entries, and the remaining entries are empty (Vector2.zero), then a connecting line will be drawn from the last point in the circle to Vector2.zero.

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 gusfai · May 02, 2012 at 09:50 PM 0
Share

Thanks!

that works...

avatar image Bunny83 · May 02, 2012 at 09:51 PM 0
Share

@gusfai: Upvote? ... Accept the answer?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Lines or curves for a smooth circle in Vectrosity 2 Answers

Vectrosity : Adding more anchor and control points 0 Answers

Multiple UI drawn circles, how to cut out any of the overlapping circles? 1 Answer

circle image on a cylinder? 1 Answer

Limit Mouse Look to Circle 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