What is difference between maya's and unity3d's mesh system?

Hello, I am trying to implementing blendshapes in unity3d in these days. At first to test mesh system in unity3d, because to ensure the same number of vertices of model between imported to unity’s and exported from maya’s. I make a cube (8 vertices, 6 faces - because it consists of rectangular), and export as obj file, and import to unity3d.

After importing, I checked how many vertices in cube, I am really surprised, because it consists of 24 vertices. (I know It consists of 12 triangles by tesselation), To implementing blendshapes, I need to same number of vertices in maya’s one and imported in unity’s one. How do I have to implement?

(P.S : If you says “How about using mega-fiers?”, we have already that kind of solution, and we want to implement own my own.)

1 Answer

1

As far as I know, there is no way to guarantee that, nor should there be, actually. The reason you’re getting more vertices in Unity than in Maya is that normal vectors are associated with vertices, not with faces. So, on edges that must appear sharp, the vertices will have to be split in order to provide two different surface normals to the faces that meet at that edge.

Consider this: If you have a cube with only 8 vertices, then the normals at the vertices would have to point in a direction which is the average of the 3 faces that meet at that vertex. This direction is directly away from the cube’s center. During lighting, you would get smoothly interpolated lights across all edges, actually making the cube look “round”, even though it is most definitely not round. Without split vertices at corners, there is no way to render sharp edges.

Vertex duplication is (in part) controlled by the Smoothing Angle slider in Unity’s mesh importer. I say “in part” because some vertex duplication must also take place in the modeling program in order to make UV coordinates wrap around the model correctly, but that is a different discussion. Here, it suffices to say that you can’t think of the visual vertices in your modelling program as a representation of the final vertex count internally, neither in Maya nor in Unity.

+1 Well explained. If you want to implement something like blendshapes you have to group vertices manually and modify them "as one", so all position changes have to be applied to all "members" of one logical vertex. If you "rotate" a vertex you have to rotate all normals by the same rotation-matrix except you actually want them handled seperately. In a lot cases you probably want them seperated when doing animations. For example if you "rotate" one corner of a cube around the y-axis the frontface will "bend" outwards while the side face bend inwards.

–

Thanks for adding detail on blendshapes and animation, Bunny. I didn't know how to answer that part. :)

–