Esempio n. 1
0
        private void AddTestData(OpenGL gl)
        {
            NMBufferGroup group = new NMBufferGroup(gl);

            var verts   = MyTrefoilKnot.Vertices.SelectMany(x => x.to_array()).ToArray();
            var normals = MyTrefoilKnot.Normals.SelectMany(x => x.to_array()).ToArray();

            group.BufferData(gl, MyTrefoilKnot.Indices, verts, normals,
                             new Material[] { new Material(new ColorF(255, 150, 50, 50), new ColorF(255, 10, 100, 10), new ColorF(255, 225, 225, 225), null, 100f) });
            group.PrepareVAO(gl, NmProgram);

            NmProgram.AddBufferGroup(group);
            NMBufferGroup groupCube = new NMBufferGroup(gl);

            var vertsCube   = FlatShadedCube.Vertices.SelectMany(x => x.to_array()).ToArray();
            var normalsCube = FlatShadedCube.Normals.SelectMany(x => x.to_array()).ToArray();


            groupCube.BufferData(gl, FlatShadedCube.Indices, vertsCube, normalsCube,
                                 new Material[]
            {
                new Material(new ColorF(1f, 0.3f, 1, 0), new ColorF(1f, 1f, 0.5f, 0), new ColorF(1f, 1, 0, 1), null, 100f),
            });

            groupCube.PrepareVAO(gl, NmProgram);

            NmProgram.AddBufferGroup(groupCube);
        }
Esempio n. 2
0
        public void AddData(uint[] indices, vec3[] verticesVec, vec3[] normalsVec)
        {
            NMBufferGroup group = new NMBufferGroup(GL);

            var verts        = verticesVec.SelectMany(x => x.to_array()).ToArray();
            var normals      = normalsVec.SelectMany(x => x.to_array()).ToArray();
            var indicesFixed = indices.Select(x => x).ToArray();

            group.BufferData(GL, indicesFixed, verts, normals,
                             new Material[] { new Material(new ColorF(255, 150, 50, 50), new ColorF(255, 10, 100, 10), new ColorF(255, 225, 225, 225), null, 100f) });
            group.PrepareVAO(GL, NmProgram);

            NmProgram.AddBufferGroup(group);
        }
 public void AddBufferGroup(NMBufferGroup group)
 {
     BufferGroups.Add(group);
 }
Esempio n. 4
0
        private void AddTestData(OpenGL gl)
        {
            NMBufferGroup group = new NMBufferGroup(gl);

            var verts = MyTrefoilKnot.Vertices.SelectMany(x=>x.to_array()).ToArray();
            var normals = MyTrefoilKnot.Normals.SelectMany(x => x.to_array()).ToArray();

            group.BufferData(gl, MyTrefoilKnot.Indices, verts, normals,
                new Material[] { new Material(new ColorF(255, 150, 50, 50), new ColorF(255,10,100,10), new ColorF(255, 225, 225, 225), null, 100f)});
            group.PrepareVAO(gl, NmProgram);

            NmProgram.AddBufferGroup(group);
            NMBufferGroup groupCube = new NMBufferGroup(gl);

            var vertsCube = FlatShadedCube.Vertices.SelectMany(x => x.to_array()).ToArray();
            var normalsCube = FlatShadedCube.Normals.SelectMany(x => x.to_array()).ToArray();

            groupCube.BufferData(gl, FlatShadedCube.Indices, vertsCube, normalsCube,
                new Material[]
                {
                    new Material(new ColorF(1f, 0.3f, 1, 0), new ColorF(1f, 1f, 0.5f, 0), new ColorF(1f, 1, 0, 1), null, 100f),
                });

            groupCube.PrepareVAO(gl, NmProgram);

            NmProgram.AddBufferGroup(groupCube);
        }
Esempio n. 5
0
        public void AddData(uint[] indices, vec3[] verticesVec, vec3[] normalsVec)
        {
            NMBufferGroup group = new NMBufferGroup(GL);

            var verts = verticesVec.SelectMany(x => x.to_array()).ToArray();
            var normals = normalsVec.SelectMany(x => x.to_array()).ToArray();
            var indicesFixed = indices.Select(x => x).ToArray();
            group.BufferData(GL, indicesFixed, verts, normals,
                new Material[] { new Material(new ColorF(255, 150, 50, 50), new ColorF(255, 10, 100, 10), new ColorF(255, 225, 225, 225), null, 100f) });
            group.PrepareVAO(GL, NmProgram);

            NmProgram.AddBufferGroup(group);
        }
Esempio n. 6
0
 public void AddBufferGroup(NMBufferGroup group)
 {
     BufferGroups.Add(group);
 }