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
1
Question by Bunnybomb7670 · Sep 06, 2013 at 05:57 PM · meshverticescountsubmesh

Submesh Vertices

I have a lot of experience when it comes to meshes, ive worked with procedural meshes in unity for a while, but i wanted to ask, how do submeshes work ? I am looking through the wiki and ive read that submeshes are pretty much the same as meshes, yet i cant seem to find how to set vertices of a submesh? is there a way to kind of make a seperate mesh , apply the vertices, triangles, uvs and make it a submesh? I cant find a submesh alternative for setting vertices, i kind of get how it works but there isnt as much documentation on submeshes as there is with meshes.

Basically, how do i use submeshes like i do with meshes?

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
3

Answer by DaveA · Sep 06, 2013 at 06:03 PM

Submeshes use the same exact vertex list as the mesh, they are just additional triangle lists.

See http://docs.unity3d.com/Documentation/ScriptReference/Mesh.SetTriangles.html and http://docs.unity3d.com/Documentation/ScriptReference/Mesh.CombineMeshes.html

Comment
Add comment · Show 11 · 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 Bunnybomb7670 · Sep 06, 2013 at 06:25 PM 0
Share

yeah but, i cant manually set the vertices? also vertices are vector3 positions. do i feed it the x y and z seperately or something?

avatar image Eric5h5 · Sep 06, 2013 at 09:53 PM 0
Share

@Bunnybomb7670: you don't do anything differently, except you have separate triangle lists. Ins$$anonymous$$d of $$anonymous$$esh.triangles (which is one triangle list), you have more than one, as indicated by $$anonymous$$esh.SetTriangles. That's it.

avatar image Bunnybomb7670 · Sep 06, 2013 at 09:54 PM 0
Share

yes, i get that bit, but how do i feed it vertex positions, do i feed it the x y z as single values or what? with a normal mesh, i set the mesh.vertices, mesh.triangles and mesh.uvs and so on, with a submesh i cant do vertices. what do i do ins$$anonymous$$d.

avatar image Eric5h5 · Sep 06, 2013 at 10:04 PM 0
Share

You don't do anything differently, except the triangle lists. It is exactly the same as working on any other mesh. For example, a mesh with one submesh (so basically a standard mesh), ins$$anonymous$$d of my$$anonymous$$esh.triangles = tris;, you do my$$anonymous$$esh.SetTriangles(tris, 0);. For more submeshes you have additional triangle lists and use 1, 2, 3, etc.

avatar image DaveA · Sep 06, 2013 at 10:41 PM 1
Share

You don't 'add vertices to a submesh'. You add vertices to THE $$anonymous$$ESH and set the triangle list(s) which ARE submeshes to reference (index) those new vertices. So if you want to alter it, get the vertices into an array, add to that array (or copy to a new bigger array), and set the vertices again. ON THE $$anonymous$$ESH. There is no 'setting vertices on submesh'

Show more comments

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

17 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

Related Questions

Combine (skinned) submeshes causes increased vertcount(for each submesh the whole vertcount) 0 Answers

Sort mesh vertices before automatic sub-mesh creation 0 Answers

Alternative Ways of Finding Vertices 2 Answers

Import mesh with submeshes from OBJ? 2 Answers

Changing Mesh Vertex Colors in editor 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