I am writing a C ++ program that acquires 4-dimensional point data over a UDP socket and then displays the data in 6 separate 2D scatter plots. For example, if we call the dimensions: A, B, C, D, then the sixth 2d graphs are AxB, AxC, AxD, BxC, BxD, and CxD. For several hours, the program accrues ~ 50 thousand Points.
Currently, I draw each point once using immediate mode. I do not clear the buffer between draw calls, so the previously drawn points are saved until the buffer is cleared. I am not happy with this method because the immediate mode is slow and outdated. When I need to clear the buffer, as when resizing a window, I will lose all previously built data. I would like to come up with a solution that allows saving data after flushing the buffer. In addition, it would be nice if the graph could be easily scaled by resizing the window.
I was thinking of supporting an array of vertices (with 2 dimensions) for each coordinate system, but this would require 6 separate arrays and 3 times the memory needed to store an array with all 4 dimensions.
I think about it right? What is the correct solution to this problem?
The ultimate goal is to have an application that displays data as close to real time as possible.
Change . Can I continue to draw dots one by one when they enter, and when I need to resize the screen, capture a screen image and then display a modified version of this image?
source
share