Exemplo n.º 1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public Mesh(IEnumerable <Point3d> vertices,
                    IEnumerable <Pointd> uvs,
                    IEnumerable <int> indices)
        {
            if (vertices == null)
            {
                throw new ArgumentNullException("vertices");
            }

            if (indices == null)
            {
                throw new ArgumentNullException("indexes");
            }

            if (uvs == null)
            {
                throw new ArgumentNullException("uvs");
            }

            VertexArray    = vertices.ToArray();
            IndexArray     = indices.ToArray();
            TextureUVArray = uvs.ToArray();

            if (VertexArray.Count() != TextureUVArray.Count())
            {
                throw new ArgumentException(
                          "頂点配列とテクスチャUV配列の数が一致しません。");
            }

            if (IndexArray.Count() % 3 != 0)
            {
                throw new ArgumentException(
                          "インデックス配列は三角形による指定をお願いします。");
            }
        }
Exemplo n.º 2
0
 public long Count()
 {
     return(IndexArray.Count());
 }