РЕДАКТИРОВАТЬ: Хорошо, несмотря на то, что мой первоначальный вопрос был принят вашей автоматической проверкой, кто-то хочет более подробной информации. А) Я пытаюсь понять, как рисовать пунктирные линии в OpenTK.Graphics.OpenGL4 версии 3.1.0.0. Б) Определение объекта(ов), которое я использую, следующее:
'''
Код: Выделить всё
public RenderObject(Vertex[] vertices, PrimitiveType ptype, float lineWidth, ObjectType otype)
{
_vertexCount = vertices.Length;
_vertexArray = GL.GenVertexArray();
_buffer = GL.GenBuffer();
_primitiveType = ptype;
_lineWidth = lineWidth;
_otype = otype;
_isAxisLine = (otype == ObjectType.AxisLine);
_isXYGridLine = (otype == ObjectType.XYGridLine);
_isXZGridLine = (otype == ObjectType.XZGridLine);
_isYZGridLine = (otype == ObjectType.YZGridLine);
_isPathLine = (otype == ObjectType.PathLine);
_isExtentLine = (otype == ObjectType.ExtentLine);
_isBoundaryLine = false; // NYI
GL.BindVertexArray(_vertexArray);
GL.BindBuffer(BufferTarget.ArrayBuffer, _vertexArray);
// create first buffer: vertex
GL.NamedBufferStorage(
_buffer,
Vertex.Size*vertices.Length, // the size needed by this buffer
vertices, // data to initialize with
BufferStorageFlags.MapWriteBit); // at this point we will only write to the buffer
GL.VertexArrayAttribBinding(_vertexArray, 0, 0);
GL.EnableVertexArrayAttrib(_vertexArray, 0);
GL.VertexArrayAttribFormat(
_vertexArray,
0, // attribute index, from the shader location = 0
4, // size of attribute, vec4
VertexAttribType.Float, // contains floats
false, // does not need to be normalized as it is already, floats ignore this flag anyway
0); // relative offset, first item
GL.VertexArrayAttribBinding(_vertexArray, 1, 0);
GL.EnableVertexArrayAttrib(_vertexArray, 1);
GL.VertexArrayAttribFormat(
_vertexArray,
1, // attribute index, from the shader location = 1
4, // size of attribute, vec4
VertexAttribType.Float, // contains floats
false, // does not need to be normalized as it is already, floats ignore this flag anyway
16); // relative offset after a vec4
// link the vertex array and buffer and provide the stride as size of Vertex
GL.VertexArrayVertexBuffer(_vertexArray, 0, _buffer, IntPtr.Zero, Vertex.Size);
_initialized = true;
_isVisible = true;
}
GL.DrawArrays(PrimitiveType.Lines, 0, _vertexCount);
C) Линии (которые в настоящее время являются «сплошными» линиями) отображаются с использованием
GL.DrawArrays(PrimitiveType.Lines, 0, _vertexCount);
C) p>
Поскольку я не вижу PrimitiveType, описывающего «пунктирные» или «пунктирные» линии, я пытаюсь понять, как это сделать. Я не знаю, как сформулировать этот вопрос более лаконично, поэтому задавайте вопросы, и я постараюсь предоставить дополнительную информацию. Спасибо.
Подробнее здесь: https://stackoverflow.com/questions/790 ... tted-lines