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 $$anonymous$$ · Dec 19, 2013 at 06:10 PM · meshverticestrianglesmesh verticesmesh manipulation

Remove unnecessary vertices from plane mesh

I have a horizontal planar mesh that I believe could be reduced in polys (illustrative example of before and possible after below --all vertices have the same y value).

alt text

alt text

My approach so far would be to do this:

 var vertices = mesh.vertices;
 foreach (var vertex in vertices)
 {
     if (isVertexOnEdgeOfMesh(vertex, mesh)) continue;

     var connectingVertices = GetConnectingVertices(vertex, mesh);
     var removable = true;
     foreach (var connectingVertex in connectingVertices)
     {
        if (vertex.y == connectingVertex.y) continue;

        removable = false;
        break;
     }

     if (removable)
     {
        //remove vertex here
     }
 }

The idea is to remove any vertex that is not on an edge, and that also shares the same y value with all of its neighbors.

I'm not sure if this is even the right approach, but even if it is, I don't know how to remove the vertex without screwing up the triangles in the mesh. I don't see any reason why this type of thing shouldn't be possible, give the layout of the mesh, but maybe I'm missing something?

example.png (13.7 kB)
example_2.png (8.3 kB)
Comment
Add comment · Show 2
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 robertbu · Dec 19, 2013 at 07:37 PM 0
Share

The two easiest approaches depending on how you are using the plane:

1) Use the CreatePlane editor script. This script allow you to set the number of divisions, so if you want a two-triangle plane, you can create one.

2) If your plane is for vertical use, use Unity Quad game object ins$$anonymous$$d. It is a two triangle plane.

Finally if you want to create the plane in code, it would likely be easier to create the whole plane from scratch rather than trying to edit existing planes. If you hunt around, you will find a number of examples of scripts for creating planes.

avatar image $$anonymous$$ · Dec 19, 2013 at 08:05 PM 0
Share

the mesh is joined from a bunch of plane meshes of all the same width and height. the plane meshes have either 2 tris (1x1) or 8 tris (2x2) the final mesh isn't necessarily a square but its width/height is based of the number of plane meshes it was originally composed of.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Benjames · Mar 05, 2015 at 06:15 PM

I had a question similar to this and I ended up answering it my self.

heres the link: http://answers.unity3d.com/questions/586474/mesh-simplification-for-marching-cubes-algorithm.html

I will maybe repost an edit with some details on how i did it, right now all I remember is that is was in some sorta backwards way.

Mainly nobody has posted on this question for two years so Im not sure if still need an answer.

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

18 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

Related Questions

How to generate a track / path mesh using waypoints,How do I generate a track / path mesh using waypoints 0 Answers

Accessing Mesh: Triangle and Vertex array fields directly? 0 Answers

Flattening a mesh by deforming it 0 Answers

Why does the default Unity sphere have duplicate vertices? 1 Answer

delete specific triangles / polygons in a mesh 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