Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 solocs · Aug 16, 2021 at 02:24 AM · verticesmeshcollidervertex

What are some practical ways performance-wise to get a set of vertices in an area?

I'm trying to do something like this where if I click then I get the nearby vertices. https://i.imgur.com/Ab70v4v.png

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 Bunny83 · Aug 18, 2021 at 07:58 AM

Well "practical" always depends. You haven't given any information on what is your input information and you also didn't clarify a lot of things.

Some of those things are:

  • is that "area" specifed in worldspace or in screen space?

  • if it's in worldspace, do you think of a selection volume (like a sphere / max distance around / from a point)? Or do you think about a max distance across the possibly curved surface?

  • Does your selection start at one of the vertices or do you want to freely select any point on the surface of the mesh?

  • If it's supposed to be a selection volume, are you only interested in those vertices that "face" a certain direction? At least in your image you don't seem to be interested in those on the backside of your sphere that are also inside the "area".

  • What aboug potential gaps in the mesh? Can the selection jump over holes? Think about selecting the top of a "U" shape. Do you want to select some vertices from the left and some from the right side, even they are not connected directly?


Apart from all of this, what you need in most cases (especially if the mesh has many vertices) is neighboring information. So an efficient way to query which vertices are next to others. This can be precalculated and saved alongside the mesh. The only alternative would be to iterate through all vertices all the time to find the ones that are close to your desired start.


To determine which vertices are connected to which others you can just use the list of triangles. So for each vertex index you can essentially remember a list of indices that are directly connected to the one in question. Keep in mind that meshes can have UV seams or generally duplicated vertices (like a cube in order to specify a normal for each face). So when creating the neigboring information you probably want to account for duplicate vertices (i.e. vertices that have the same position but differ in other vertex attributes such as normal, uv, tangent or vertex color).


Since the question is extremely vague I won't go into any more detail here as this would be a waste of time.

Comment
Add comment · Show 1 · 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 · Aug 18, 2021 at 08:05 AM 0
Share

ps: we had already questions like Is there an easy way to find connected vertices in Mesh.vertices? in the past. So please check the available resources first :)

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

124 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 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 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 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

Precise vertex positions 1 Answer

Why vertex positions appear (0.0, 0.0, 0.0) ? 1 Answer

Changing Y Value in Vertex Array? 1 Answer

Making the camera follow vertices 0 Answers

Raycasting to the polygon level. 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