Esempio n. 1
0
 void GenerateLineVBO()
 {
     Renderable.ArrayBuilder builder = new Renderable.ArrayBuilder();
     builder.Prepare2D(2, 2);
     for (uint n = 0; n < 2; n++)
     {
         builder.Indices[n] = n;
         builder.Colors[n]  = new Vector4(1, 1, 1, 1);
         builder.Normals[n] = new Vector3(0, 0, 1);
     }
     builder.Vertices[0]  = new Vector3(0, 0, 0);
     builder.TexCoords[0] = new Vector3(0, 0, 0);
     builder.Vertices[1]  = new Vector3(1, 0, 0);
     builder.TexCoords[1] = new Vector3(1, 0, 0);
     Line = builder.Generate();
 }
Esempio n. 2
0
 void GenerateSquareOfLinesVBO()
 {
     Renderable.ArrayBuilder builder = new Renderable.ArrayBuilder();
     builder.Prepare2D(5, 5);
     for (uint n = 0; n < 5; n++)
     {
         builder.Indices[n] = n;
         builder.Colors[n]  = new Vector4(1, 1, 1, 1);
         builder.Normals[n] = new Vector3(0, 0, 1);
     }
     builder.Vertices[0]  = new Vector3(1, 0, 0);
     builder.TexCoords[0] = new Vector3(1, 0, 0);
     builder.Vertices[1]  = new Vector3(1, 1, 0);
     builder.TexCoords[1] = new Vector3(1, 1, 0);
     builder.Vertices[2]  = new Vector3(0, 1, 0);
     builder.TexCoords[2] = new Vector3(0, 1, 0);
     builder.Vertices[3]  = new Vector3(0, 0, 0);
     builder.TexCoords[3] = new Vector3(0, 0, 0);
     builder.Vertices[4]  = new Vector3(1, 0, 0);
     builder.TexCoords[4] = new Vector3(1, 0, 0);
     SquareOfLines        = builder.Generate();
 }