Пример #1
0
 public RenderableModel(List <Vector3> verts, List <Vector3> vertcolors, List <int> indicies, string shadername)
 {
     Verticies    = verts;
     VertexColors = vertcolors;
     Indicies     = indicies;
     ShaderName   = shadername;
     VaoID        = GLManager.BindRenderableModel(this);
 }
Пример #2
0
        private void BuildGrid()
        {
            Verticies = new List <Vector3>();
            Verticies.Add(new Vector3(0, -GridCount, 0));
            Verticies.Add(new Vector3(0, GridCount, 0));
            for (int i = -GridCount; i <= GridCount; i++)
            {
                Verticies.Add(new Vector3(i, 0, -GridCount));
                Verticies.Add(new Vector3(i, 0, GridCount));
                Verticies.Add(new Vector3(-GridCount, 0, i));
                Verticies.Add(new Vector3(GridCount, 0, i));
            }

            VertexColors = new List <Vector3>();
            VertexColors.Add(new Vector3(0, 1, 0));
            VertexColors.Add(new Vector3(0, 1, 0));
            for (int i = -GridCount; i <= GridCount; i++)
            {
                if (i == -2)
                {
                    VertexColors.Add(new Vector3(0, 0, 1));
                    VertexColors.Add(new Vector3(0, 0, 1));
                    VertexColors.Add(new Vector3(1, 0, 0));
                    VertexColors.Add(new Vector3(1, 0, 0));
                }
                else
                {
                    VertexColors.Add(new Vector3(0.6f, 0.6f, 0.6f));
                    VertexColors.Add(new Vector3(0.6f, 0.6f, 0.6f));
                    VertexColors.Add(new Vector3(0.6f, 0.6f, 0.6f));
                    VertexColors.Add(new Vector3(0.6f, 0.6f, 0.6f));
                    VertexColors.Add(new Vector3(0.6f, 0.6f, 0.6f));
                }
            }

            VaoID = GLManager.BindGrid(this);
        }