Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 ArniBoy · Aug 11, 2013 at 01:15 PM · meshnormalsfaces

Procedural mesh, half the faces have wrong normals

I have a script which produces a mesh. It gets an array of (2D) vertices and then just butchers around until the (3D) mesh is done. The Math behind it is really not that complicated, which is why I don't see where I am currently wrong. Here are two screenshots showing my problem:

Front Back

As you can see, half of the triangles face inwards. I tried generating the triangleIndices differently, so that all are generated clockwise. That didn't do anything though (Although I am 100% sure that it should, I mean, that is how the normals are natively generated, or am I wrong?). Next I called "generateNormals()" for the mesh, still wrong faces. In what you see now, I just gave the first half of the vertices (0, 0, -1) and the second half (0, 0, 1) as normals, which is a horrible way of solving it, bit I thought would at least show them all. But alas, it doesn't.

Before I rewrite all my code to triangleStrip, I wanted to ask if I am doing something obvious wrong.

capture1.png (14.6 kB)
capture2.png (30.6 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

1 Reply

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

Answer by ArniBoy · Aug 11, 2013 at 02:28 PM

I stumbled over a thread, and it contained the answer. Just in case anyone finds this and wonders what the answer was, here: http://answers.unity3d.com/questions/187637/procedural-meshs-normals-are-reversed.html

It was what I has suspected, not the vertexnormals are the problem, as they seem to only be used for lighting and such. I am just too bad at writing code, and need to learn how to handle arrays properly.

Cheers, Arne

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

14 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Conform mesh to arbitrary surfaces? 3 Answers

What are normals? 1 Answer

duplicate and flip mesh in code 5 Answers

Triangulation for Unity Mesh from Edges 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