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 /
This question was closed Dec 30, 2014 at 11:33 PM by AlucardJay for the following reason:

Question is off-topic or not relevant, not a Unity specific technical question.

avatar image
0
Question by Avanak · Dec 30, 2014 at 10:16 PM · linerendererspacecircleplanet

Help with drawing circles in real time

I'm creating a 2D space game where I am procedurally generating a simple star system. I would like to be able to render a circle at the orbits of the planet. Something like this: http://spaceengine.ucoz.ru/_fr/11/s0498649.jpg ,but in 2D. The centre of the circle will be at the star and the radius the distance of the planet to the star. In know about line renderer but I have no experience using this. Can someone help me with this?

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

  • Sort: 
avatar image
1

Answer by AlwaysSunny · Dec 30, 2014 at 10:22 PM

The lines in the linked image look like trails, not circles. At least for prototyping, the trail renderer will produce acceptable trails.

For circles, it gets a little funny: You could obviously scale a raster image of a circle, but this is only useful in certain situations. Not suitable for dynamic sizes or scrutiny at many resolutions.

You could draw N line segments that sweep a circle's circumference. Learning to do this will impart handy knowledge for other line- and shape-drawing techniques. You'll learn mesh generation, billboarding techniques, and make use of the Graphics.DrawMeshNow method to render the mesh to the screen.

The other method I've used involves a rigged mesh of a 2D toroid slice. Basically like a washer or squished doughnut. The root bone controls the outer diameter, a child bone controls the inner diameter. This is a very cheap and flexible method, but it involves some initial coding (and 3D software like Blender) to achieve a good result. Once your single rigged mesh and control script are complete, you can re-use them to draw a circle of any size, thickness, material, or planar orientation.

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

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to find the radius area of linerencderer drawn circle and move objects inside ? 1 Answer

Lighting for a planet on mobile 0 Answers

How to subdivide a cube sphere 0 Answers

Visualizing area of influence in a sci fi game 1 Answer

Keep line renderer width same on screen no matter camera distance 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