Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 wlad_s · May 17, 2018 at 08:26 PM · verticesvertexmeshestrianglesmesh manipulation

delete specific triangles / polygons in a mesh

Hello,

I have a specific problem that I don't know how to achieve. I've looked through the Mesh class documentation but I didn't get it.

I have a simple mesh, like a road really. It's basically a row of triangles similar as in the illustration. I need to interrupt that row by deleting polygons according to the position of some marker game objects. Here's the image:

alt text

I think I know how to find the vertices that are closest to to the markers. but I don't understand how to find the right triangles and how to remove them. The fact that this mesh will be split into two parts afterwards seems to be making this problem even more complicated.

Thanks for reading and I hope someone can help.

mesh-delete-tris.png (200.0 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by hexagonius · May 17, 2018 at 08:38 PM

There's two arrays of interest. one containing the vertex positions in localspace and one containing indices into that array, as a magnitude of 3, that basically describes which vertices go into which triangle. The order of those also describes which direction the surface normal is facing, where clockwise is facing backwards and counterclockwise is forward.

This whole chapter about Meshes describes all aspects in more detail.

What you basically need to do is finding out which vertices are the ones you want to delete, which of these also go into other triangles than the ones you're about to remove, exclude them and rewrite the two arrays, vertices and indices without the missing ones.
If you're talking about a mesh split, of course you need to generate the remaining vertices into two new sets of arrays.
The indexing array is exactly 3 times the vertices array, so whichever vertex you find, its index position in the indexing array tells you which triangle it belongs to (index 4 would be the second vertex of the second triangle)

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 wlad_s · May 17, 2018 at 09:31 PM 0
Share

Thank you Hexagonius! I understood everything until splitting the mesh. I don't really want to split it into two separate meshes/objects. It should still be a single mesh with two parts. As you can see in the image above, those two parts are not connected. I understood there is only one vertex and one triangle array in $$anonymous$$esh class, so that's confusing. If I put all the vertices (both from the left part and the right part) into one array, Unity will connect the parts. How can we have two vertex arrays in a single $$anonymous$$esh?

avatar image
0

Answer by BergOnTheJob · Jul 10, 2020 at 04:27 PM

Hey @wlad_s,

i know its been a while, but if this helps, this tool set can delete specific triangles / polygons in a mesh.

https://assetstore.unity.com/packages/slug/166155

It also has a bunch of other tools for modeling in Unity.

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 wlad_s · Jul 10, 2020 at 07:30 PM 0
Share

Oh wow! That's an amazing tool! Thanks! I actually needed a specific solution that would automatically work on lots of meshes by pressing one button. I've solved this problem a long time ago and have garnered much knowledge about editing meshes through scripts in the meantime. I can't even imagine how much hard work has gone into building that Oasis Editor. Congrats if you're the one who made it!

avatar image BergOnTheJob wlad_s · Jul 26, 2020 at 05:25 PM 0
Share

You're too kind, Thank you so much @wlad_s ! I created the editor all by my lonesome and it did take several months. I haven't been able to find work since the COVID outbreak in $$anonymous$$arch, so I decided to release my own software to support my family. If you have any C# Unity questions or need help creating something you can always reach me at OasisRoboticsInc@gmail.com. I got my degree in 3d computer animation 15 years ago and have been doing game development in Unity since 2013.

Thanks again! - Aaron

Aaron Bergquist Certified Unity Programmer

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

83 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

Related Questions

How to add vertex points to a mesh 1 Answer

Remove unnecessary vertices from plane mesh 1 Answer

Quick way to get touching triangles? 0 Answers

Mesh triangles don't match wireframe view? 0 Answers

Vertex triangles 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