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 mbougaa · Jun 06, 2013 at 07:22 AM · textureuvvertextriangles

UV affectation with multi submeshes

Hi, I have a serious problem with character texturing!
I’m using a character with only one mesh, and I want to apply the texture from 4 different pictures, I’ve the algorithm that allow me doing the texture correspondence (for each vertex in the mesh, the algorithm gives me : from witch picture I must get the texture and the UV coordinates on that pictures)
I’ve tried many methods but no one seems to give correct results in Unity, and now I’m working on that method:
- I added 04 Materials to the character object in the inspector
- I added 04 submeshes to the mesh (I don’t have the choice, it’s impossible to divide the mesh into 04 different meshes or different objects ) using :
mesh1.subMeshCount= 4;
- I affected the triangles array corresponding to each submesh using: mesh1.SetTriangles(triangRightTab,1);
- Using my algorithm -I talked about at the beginning- I changed the UV map to associate the uv coordinates to each vertex !!!!!!!!!!!!!!!!!!!!!!!!! like that
uvMapping[i] = new Vector2(x,y);

mesh.uv = uvMapping;

The problem is here, when I do that I’m talking with only one vertex array (the division of the mesh into submeshes don’t split the vertex table, it only concern the triangles table), so with these line, I can only tell to each vertex that his uv are (x,y) but I can’t tell him from witch picture (material) he will get them!!!!!!! So he is doing the mapping with only the material 0.

Am i missing anything, or is there a way to do that, help please it’s really taking me a lot of time. Thanks in advance

Comment
Add comment · Show 1
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 Fattie · Sep 25, 2013 at 08:12 AM 0
Share

QUESTIONER PLEASE TIC$$anonymous$$ AN ANSWER- THAN$$anonymous$$S

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Fattie · Jun 06, 2013 at 08:13 AM

Generally regarding mesh and working with UVs. Please check out these

http://answers.unity3d.com/questions/293607/tiling-uv-mapping.html

Please be sure to vote up useful answers - I love points ! :)

http://answers.unity3d.com/questions/433582/manual-uv-mapping-of-a-primitive-cube.html

http://answers.unity3d.com/questions/193695/in-unity-is-there-a-fast-way-to-find-nearby-triang.html

<-- critical information

http://answers.unity3d.com/questions/263302/vertices-array-in-mesh-vertices.html

Please read carefully this gotchya:

http://answers.unity3d.com/questions/417483/is-there-a-way-to-assign-meshverticesi-directly.html

It is critical to read and understand this:

http://answers.unity3d.com/questions/315059/how-to-improve-performance-while-generating-extrud.html

please check out some of these

http://answers.unity3d.com/questions/15832/how-to-create-a-procedural-mesh-with-multiple-mate.html

http://answers.unity3d.com/questions/292497/number-of-materials-on-a-model.html

http://answers.unity3d.com/questions/312492/submesh-creation-from-script.html

http://answers.unity3d.com/questions/38414/multiple-materials-for-multiple-submeshes.html

http://answers.unity3d.com/questions/22209/why-is-it-possible-to-add-additional-materials-to.html

I may misunderstand you, but it's this simple:

change the texture.

it's just that simple.

it would be - unbelievable - to try to do UV mapping in Unity (why?)

Simply open Cheetah3D, Blender or whatever .. or for professional use something like this http://www.polygonal-design.fr/e_unfold/features.php .. and make up the four versions of your character.

then in Unity just change the texture.

Comment
Add comment · Show 6 · 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 mbougaa · Jun 06, 2013 at 08:20 AM 0
Share

Thanks for your replay I alredy do the UV mapping using unity! my project is to assign the texture in an automatic way, it's a very complicated project i know, so i cant use a modeler like blender or another, i need to do all the work using unity and just to be more clear, i don't want to use different characters with different textures, but one character whith four texture parts (part 1 of the mesh with the texture from the material 1, part 2 of the mesh with the texture from the material 2... ) do you have any idea!

avatar image mbougaa · Jun 06, 2013 at 08:35 AM 0
Share

the fact is that i want to make an automatic real human texture mapping (from 4 different view pictures) on a 3D human avatar, and for some reason such as i'm makin a real time deformation on the final avatar, it's really not possible to divide the mesh it must stay one single mesh
i hope i'm more clear, and thaks in advance for your response

avatar image mbougaa · Jun 06, 2013 at 09:17 AM 0
Share

i dont have a problem with program$$anonymous$$g it, i'm done with all the aspect, i just need to a way to use different uv map (to adress different materials) for each set of triangles (submeshes) --> for now it took always the first material texture for all the submeshes (see the picture below)

avatar image Fattie · Jun 06, 2013 at 09:19 AM 0
Share

http://answers.unity3d.com/questions/15832/how-to-create-a-procedural-mesh-with-multiple-mate.html

avatar image mbougaa · Jun 06, 2013 at 09:30 AM 0
Share

thank you, I've seen that, and it's what i did but what that "assign materials with Renderer.materials" means, how to do it? and if i assign them, when i change the mesh.uv, is by that change of the uv map, i can tell that the u and v coordinates i give for the vertex i are from the first material, the second ...

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

15 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

Related Questions

Assigning UV Map to model at runtime 0 Answers

Understanding verts and triangles in Unity 1 Answer

Strange issue with generated mesh 2 Answers

How do you make a submesh properly? 0 Answers

Calculate UV coordinates of 3D point on plane of mesh's triangle 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