What is the replace function of glutWireCube() in OpenTK? I want to draw a few cubes quickly!! Thanks for your answers.
var cubeIndices = new int[] { // front face 0, 1, 2, 2, 3, 0, // top face 3, 2, 6, 6, 7, 3, // back face 7, 6, 5, 5, 4, 7, // left face 4, 0, 3, 3, 7, 4, // bottom face 0, 1, 5, 5, 4, 0, // right face 1, 5, 6, 6, 2, 1, }; var cubeVertices = new Vector3[] { new Vector3(-1.0f, -1.0f, 1.0f), new Vector3( 1.0f, -1.0f, 1.0f), new Vector3( 1.0f, 1.0f, 1.0f), new Vector3(-1.0f, 1.0f, 1.0f), new Vector3(-1.0f, -1.0f, -1.0f), new Vector3( 1.0f, -1.0f, -1.0f), new Vector3( 1.0f, 1.0f, -1.0f), new Vector3(-1.0f, 1.0f, -1.0f) };
You can upload this to a VBO or draw it with immediate mode:
GL.Begin(BeginMode.Triangles); foreach (int index in cubeIndices) GL.Vertex3(cubeVertices[index]); GL.End();
Use GL.PolygonMode() to enable wireframe mode.
GL.PolygonMode()
Thanks~~~
Comments
Re: What is the replace function of glutWireCube() in ...
You can upload this to a VBO or draw it with immediate mode:
Use
GL.PolygonMode()to enable wireframe mode.Re: What is the replace function of glutWireCube() in ...
Thanks~~~