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 /
avatar image
0
Question by seth_slax · Sep 22, 2015 at 06:03 AM · meshverticesgroup

Grouping vertices?

Hey everyone. I have a model that, when in Max has only 1,002 vertices. When exported into Unity, it has 5,722. This is (from what I've researched) due to the vertices requiring multiple normal-facing directions to allow it to render hard edges and flat faces (exported intentionally without any smoothing groups).

Basically what I've written so far shoots a raycast from the mouse position to the mesh, and from the hit point, gathers the closest, say 80 verts. It then iterates through all the verts and grabs any that share the exact position of the chosen 80. All these verts are then stored in a different array and operated on.

What I'd like to know is if there is any way to group all shared vertices in something simple so I can simply reference them all at once? Ideally, something like a hash-table that stores multiple values per key. All I can think of so far is creating a 2D array to store their int position in the main vertices array, but that would still require iterating through the entire thing to find what group a vert belongs to. Any ideas?

Comment
Add comment · Show 1
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 seth_slax · Sep 23, 2015 at 02:36 AM 0
Share

I probably should have mentioned that I need 1,002 'containers' (one for each of the original vertices) to store the between 4 and 6 values each. I tried creating a list of lists to iterate through, however it gave the profiler a stroke using the List.Contains method so frequently. I avoided trying the old JS arrays since apparently they should be forgotten altogether. I also tried multidimensional arrays - [ , ], however each array needs to have a size between 4 and 6, so they need to be more like jagged arrays, which seem practically impossible to initialize in JS, at least the way I need them. The way it is currently set up works decently enough, it's just a little too CPU-heavy.

1 Reply

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

Answer by seth_slax · Sep 25, 2015 at 09:11 AM

So it seems like (strangely enough) the most efficient way is to just not group vertices and iterate through them every time. I've tried practically everything that I could find (lists of lists, multidimensional arrays, jagged arrays, arrays of arrays), but none of these options run anywhere near as fast according to the profiler.

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

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

28 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

Related Questions

Alternative Ways of Finding Vertices 2 Answers

How to find the closest 4 verts/corners ( along with their orientation ) of a rectangular object in relationship with another object? 1 Answer

mask one gameObject mesh by another mesh vertex transparency 1 Answer

Creating a mesh out of a linerenderer - how do you convert revolved vertices set to triangles and uv's 1 Answer

Mirror vertices procedurally 2 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