예제 #1
0
        public void FillVBO()
        {
            List <float> data = new List <float>();

            foreach (Face f in faces)
            {
                for (int i = 0; i < 3; ++i)
                {
                    data.Add(verts[f.Indices[i][(int)VERTEX_DATA_TYPE.POSITION] - 1]);
                    data.Add(normals[f.Indices[i][(int)VERTEX_DATA_TYPE.NORMAL] - 1]);
                    int uvIndex = f.Indices[i][(int)VERTEX_DATA_TYPE.UV] - 1;
                    if (uvIndex >= 0)
                    {
                        data.Add(uvs[uvIndex]);
                    }
                    else
                    {
                        data.Add(Vector2.Zero);
                    }
                }
            }
            vbo.SetData(data.ToArray());
        }
예제 #2
0
 public void Generate()
 {
     myVBO.SetData(faces);
 }
예제 #3
0
 public void Populate()
 {
     myVBO.SetData(seaMesh);
 }