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 /
  • Help Room /
avatar image
1
Question by MakakWasTaken · Nov 01, 2015 at 09:08 AM · vector3runtimegridspherevertices

How to calculate the vertices of an icosphere

How can I calculate the vertices of an icosphere and identify them with x,y coordinates? I want to generate an icosphere grid of vertices.

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

Answer by Bunny83 · Nov 01, 2015 at 11:26 AM

Start by creating a Icosahedron which is actually the "smallest" icosphere.

Then you can use a simple subdivide method like the ones i've posted over here(don't miss the link to the wiki at the end).

Once subdivided you simply "normalize" all vertices so they have the same distance from the center. If the Icosahedron has been created around the local origin you can simply do

 v = v.normalized * radius;

for each vertex.

You can repeat the subdiv process several times if you want to get the desired resolution.

I'm just a bit confused since you said "x, y" instead of "x,y,z" and used the term "grid". Those terms usually refer to 2d while a sphere is a 3d object. Maybe i didn't get what you actually want. If that's not what you want, feel free to edit your question and include more details, maybe a drawing or screenshot of what you want.

Comment
Add comment · Show 6 · 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 Bunny83 · Nov 01, 2015 at 02:52 PM 0
Share

Just realised that the wiki link was still an old link ^^. Fixed the link.

avatar image MakakWasTaken · Nov 01, 2015 at 05:08 PM 0
Share

I actually need to map the icospheres sides into a 2d array, but I might have to give each side of the sphere a int to identify it by. This picture kinda describes the problem with this: alt text Let's say that on the left side is "Side 1" and the right one is "Side 2" I then need to function for point 1,1 to find 0,3 as it's neighbour.

4clnp.jpg (20.4 kB)
avatar image MakakWasTaken · Nov 01, 2015 at 06:25 PM 0
Share

I can only come up with one solution for this and it is to check after the 8 closest points to the neighbour sorted by distance, but this would take a lot of time because it would have to scan all the vertices every time it had to get the neighbour of one node, but I could scan the sphere once and then make each node have a list of the pre-computed neighbours. This would kinda fix the problem, but do anyone have a better solution for this?

avatar image Bunny83 MakakWasTaken · Nov 02, 2015 at 01:21 AM 0
Share

Sorry, but i have no idea what you actually want. An icosphere doesn't really have a "side". You talk about a two dimensional array, but what relation does your array have with the icosphere? An icosphere consists of triangles, not quads, so how do you put them into a 2d array?

Your question just asked how to generate the vertices of an icosphere. I'm not sure what you mean by "identify them with x,y coordinates". Do you mean to use polar coordinates on the sphere? Are you sure you talk about an icosphere? Since you talk about neighbors, neighbors of what? If you mean adjacent vertices of a vertex? A vertex of an icosphere has either 5 or 6 adjacent vertices. If you talk about triangles, each triangle has exactly 3 neighbors. I don't see where your "2d grid" fits into this.

Feel free to edit your question and add more details. At the moment it's not really clear what you want to do.

avatar image MakakWasTaken Bunny83 · Nov 02, 2015 at 04:40 PM 1
Share

I am sorry, I have totally misunderstood the term icosphere. $$anonymous$$y misunderstanding is caused by me googling around trying to find a solution which gave me a sphere which I though was an icosphere because it continously appeared with the context icosphere. I though this was an icosphere: Spherified Cube This sphere clearly has sides which can be used in a 2D array, but I have now tried to implement a 3d array ins$$anonymous$$d, because the way to use this seems to be way easier with a 3 dimensional array.

cube12.jpg (46.5 kB)
Show more comments

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

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

Related Questions

delete vertex on spheres 0 Answers

How do I account for rotation in a snap to function? 0 Answers

Static value “lost” in Unity when called on second script 0 Answers

Access to grid points on a sphere? 0 Answers

assigning several positions and call array of raycasts 0 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