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 tuf91497 · Jul 17, 2018 at 05:05 PM · meshverticesnormalsprocedural meshtriangles

Holes in procedural mesh

alt text So I have a text file that defines coordinates for every vertex and indices for every triangle in a mesh. I have a script that I taught to read the data file and form a vertex and triangle array from. I then told my script to generate the normals array by using the RecalculateNormals function. My shape comes out almost correct, but it appears that some of the normals are facing the wrong way. I believe that it's the normals facing the wrong way because you can't see through the object like this when it is facing the other way: alt text

Additionally, the original file is a vtk file, and when I put it into Paraview, the file displays without problem, so I don't think that it's an issue with the vertex or triangle information.

I think that the problem is in the RecalculateNormals method, but I'm not sure how to fix it.

meshholesfront.png (308.3 kB)
meshholesback.png (467.7 kB)
Comment
Add comment · Show 4
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 sbsmith · Jul 17, 2018 at 05:57 PM 1
Share

It's possible that your mesh algorithm is generating one-dimensional triangles in some spots. I had a similar problem with dynamic physics meshes. There was a bug in my code that would make triangles where two vertices were in the same place. If this happens, RecalculateNormals is unable to calculate a proper normal based on a clockwise winding order.

avatar image sbsmith sbsmith · Jul 17, 2018 at 05:58 PM 1
Share

The easiest way to find out if this is the problem is to make a Gizmo that draws the mesh normals.

avatar image tuf91497 sbsmith · Jul 17, 2018 at 07:05 PM 0
Share

Do you mean that out of the three indices in a triangle, more than one of the indices are the same?

Because otherwise my script almost definitely has three dimensions for each triangle. The number of triangles is divisble by three, and I've checked the first and last couple of triangles at the beginning and end of the array, and they all contain three unique indices and match what they should be according to the original data file.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

99 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

Related Questions

Problem drawing a mesh with Graphics.DrawMeshNow 1 Answer

How to make sure two meshes have the same vertex count 0 Answers

What's wrong with this simple mesh manipulation? 1 Answer

Why is my mesh peeling off when I try to deform it during runtime? 1 Answer

Why does the default Unity sphere have duplicate vertices? 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