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 MatriXz · Jun 22, 2018 at 07:49 PM · meshverticesuv mappingtrianglesscipting

Making Different vertices,triangle,uv maps in the same mesh

Hi friends.

Im working on a big project, where i procedually generate a "minecraft like" terrain, and i've created a building creator in the same way. Heres how it works (code is tooo complex to share here).
Each building is divided into levels which have each their own chunk of boxes. each chunk is a mesh created via vertex, triangle and uv mapping.
Aslong as i keep to just using cube shaped forms in the algoritem, it seems to be working perfectly. BUT, i tried creating a different shape the same way, in a static class, that generates the verts, uvs and tris and return those to the chunk class, and then adding them to the rest of the verts, uvs and triangles.. This resulted in a huge mashup of the shapes, It did not make any sence.
My solution was to create a different mesh all together that works together with the other ones in a complex way, and this way each shape would have its own mesh generator and chunk class. (no problem with 1-5 shapes, buuut i have plans to make 20-30 different shapes, so you see the problem).
So my question is: Is it possible to mix several shapes in the same mesh like im trying to do?
If not, do you have any suggestions ?
ALSO, Why not? and is there anywhere i can read a full guidelines of what the rules for creating meshes manually? Something like "Do's and Dont's".
Thanks for any help.

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 MatriXz · Aug 02, 2018 at 10:23 AM

I solved this.

So if anyone has a similar situation, heres what did the difference.

Instead of adding to the list of triangles, uvs and verticies with the List.AddRange() method. I instead passed the lists to the method that calculates the faces, and add the values directly via the reference.
Logically this makes no sence to me, since passing the reference of a list to a method and letting the method add to the list, is exactly the same as returning an object and then AddRange the values into the list. But i guess theres something internally in the AddRange method that screws up the list or something.

Hope this helps

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

95 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

Related Questions

Null Reference Exception Assigning Vertices to Mesh 0 Answers

Lighting up all triangles between two points in a mesh? 1 Answer

How to return from shader the indexes of triangles/vertices that was actually rendered? 1 Answer

Can you apply smoothing to split vertices on a generated mesh? 1 Answer

Get an specific vertices of 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