我想使用OpenTK绘制一个3d对象的线框, 但是我不想用opentk方法绘制它,但是我想我必须通过绘制opentk buffor来做它,但不知道如何开始。我的意思是,我有一个绘制方法,但如何从OpenTK覆盖绘图?
// Push current Array Buffer state so we can restore it later
GL.PushClientAttrib(ClientAttribMask.ClientVertexArrayBit);
GL.Color3(Color.SkyBlue);
//GL.ClientActiveTexture(TextureUnit.Texture0);
//GL.BindTexture(TextureTarget.Texture2D, tex);
GL.BindBuffer(BufferTarget.ArrayBuffer, dataBuffer);
// Normal buffer
GL.NormalPointer(NormalPointerType.Float, 0, (IntPtr)(normOffset * sizeof(float)));
// TexCoord buffer
GL.TexCoordPointer(2, TexCoordPointerType.Float, 0, (IntPtr)(texcoordOffset * sizeof(float)));
// Vertex buffer
GL.VertexPointer(3, VertexPointerType.Float, 0, (IntPtr)(vertOffset * sizeof(float)));
// Index array
GL.BindBuffer(BufferTarget.ElementArrayBuffer, indexBuffer);
GL.DrawElements(BeginMode.Triangles, mesh.Tris.Length * 3, DrawElementsType.UnsignedInt, IntPtr.Zero);
// GL.DrawElements(BeginMode.Lines, mesh.Tris.Length * 3, DrawElementsType.UnsignedByte, IntPtr.Zero);
// Restore the state
GL.PopClientAttrib();