Beispiel #1
0
        public ModelInformation LoadModel(Face[] faces)
        {
            ModelInformation mi = new ModelInformation(data.Count / 8, faces.Length * 3);

            for (int i = 0; i < faces.Length; i++)
            {
                for (int f = 0; f < 3; f++)
                {
                    data.Add(faces[i].v[f].X);
                    data.Add(faces[i].v[f].Y);
                    data.Add(faces[i].v[f].Z);

                    data.Add(faces[i].c0);
                    data.Add(faces[i].c1);
                    data.Add(faces[i].c2);

                    data.Add(faces[i].specularity);
                    data.Add(faces[i].reflectivity);
                }
            }

            GL.BindBuffer(BufferTarget.ArrayBuffer, vbo);
            GL.BufferData(BufferTarget.ArrayBuffer, data.Count * sizeof(float), data.ToArray(), BufferUsageHint.StaticDraw);

            return(mi);
        }
Beispiel #2
0
 public ModelRenderer(ModelInformation mi) : this(mi, Matrix4.Identity)
 {
 }
Beispiel #3
0
 public ModelRenderer(ModelInformation mi, Matrix4 transform)
 {
     this.mi        = mi;
     this.transform = transform;
 }