Exemplo n.º 1
0
        private void assembleVertices()
        {
            var poly      = xMesh.Element($"{ns}polylist");
            var typeCount = poly.Elements($"{ns}input").Count();
            var id        = ArrayParsers.ParseInts(poly.Element($"{ns}p").Value);

            for (int i = 0; i < id.Count / typeCount; i++)
            {
                var textureIndex = -1;
                var colorIndex   = -1;
                var index        = 0;

                var posIndex    = id[i * typeCount + index]; index++;
                var normalIndex = id[i * typeCount + index]; index++;

                if (Textures != null)
                {
                    textureIndex = id[i * typeCount + index]; index++;
                }

                if (Colors != null)
                {
                    colorIndex = id[i * typeCount + index]; index++;
                }

                processVertex(posIndex, normalIndex, textureIndex, colorIndex);
            }
        }