Create trace from .*segy

Hi there, I am new in OpenGL. I try to plot chart, data i get fron file segy. How can I convert data from std::vector to coordinates OpenGL?

example of code:

void RenderingWindow::render(const RenderState *state)
{
    auto const f = QOpenGLContext::currentContext()->functions();
    if (!f) {
        return;
    }
    m_vec = {-0.515932, -0.591868, -0.678215, -0.776175, -0.000887242, -1.01284}; //convert to coords

    f->glClearColor(0.2, 0.2, 0.2, 1.0);

    f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    GLuint vbo;
    f->glGenBuffers(1, &vbo);
    f->glBindBuffer(GL_ARRAY_BUFFER, vbo);
    f->glBufferData(GL_ARRAY_BUFFER, m_vec.size() * sizeof(float), m_vec.data(), GL_STATIC_DRAW);

    f->glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), (void*)0);

    f->glEnableVertexAttribArray(1);
    f->glLineWidth(1);
    f->glDrawArrays(GL_LINE_STRIP, 0, m_vec.size());

    f->glDisableVertexAttribArray(0);
    f->glBindBuffer(GL_ARRAY_BUFFER, 0);
    f->glDeleteBuffers(1, &vbo);
}

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.