3d data visualization, draw lines
-
I am trying to draw some triangles and lines in specified positions, in the 3d bar graph, but i can't see anything.
I inherit from Q3DBars, then i add this function:
glEnableVertexAttribArray(m_pos); glEnableVertexAttribArray(m_col); glVertexAttribPointer(m_pos, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(m_col, 3, GL_FLOAT, GL_FALSE, 0, colors); glDrawArrays(GL_TRIANGLES, 0, 3);
I tried to call it in the constructor, but there's nothing in the scene, except for the empty axis. I can't find any virtual function like draw to replace. Both in the QAbstract3DGraph and QCustom3DItem, there's nothing useful to replace.
I tried to find Q3DScene, but none of the objects contains it. Which object is the container for the scene objects? Where should i put that code to draw objects at custom positions? I was thinking to add a scatter series at the top of bar series, and maybe there i could put the objects in custom positions, but they both must be aligned.
-
I am trying to draw some triangles and lines in specified positions, in the 3d bar graph, but i can't see anything.
I inherit from Q3DBars, then i add this function:
glEnableVertexAttribArray(m_pos); glEnableVertexAttribArray(m_col); glVertexAttribPointer(m_pos, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(m_col, 3, GL_FLOAT, GL_FALSE, 0, colors); glDrawArrays(GL_TRIANGLES, 0, 3);
I tried to call it in the constructor, but there's nothing in the scene, except for the empty axis. I can't find any virtual function like draw to replace. Both in the QAbstract3DGraph and QCustom3DItem, there's nothing useful to replace.
I tried to find Q3DScene, but none of the objects contains it. Which object is the container for the scene objects? Where should i put that code to draw objects at custom positions? I was thinking to add a scatter series at the top of bar series, and maybe there i could put the objects in custom positions, but they both must be aligned.