سؤال

So, I'm kinda new to Xna development and after reading about the handling of 3d model, I've got a doubt. I know that when we have a model, that model can have multiple meshes and each mesh multiple parts, but I don't really get such division, it seems to me like an overkill. In particular, I don't get the diffence between mesh and part and what is the latter for. I know that such a basic topic but could you clearify that to me?

هل كانت مفيدة؟

المحلول

A Model is an arbitrary collection of independent objects.

A Mesh is one of the aforementioned objects inside of a Model. Each Mesh can be transformed and drawn independently of any others within the same model.

A MeshPart contains all of the information required to draw one piece of a Mesh. A mesh can have multiple parts because some of those parts may have different rendering parameters: for example, they may use different shaders or textures.

Consider a model representing a windmill. It has two separate meshes: one representing the windmill's tower, and another representing the windmill's sails. The tower has a single part, but the sails have two: one part, consisting of the wooden frame and drawn using BasicEffect; and another part, consisting of the sailcloth, which uses a special vertex shader to make the fabric flutter in the wind.

Does that make sense?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top