- Home /
Real time graphing
Hi, I am trying to plot a real time graph every time a data comes in. I make use of the line renderer for the plotting but I encounter some issues and would like to seek some advice. I have a fixed size for my length of line renderer and it manage to plot like how I wanted it to be.
My line renderer use something like: pos = new Vector3(time,data,0) lrenderer.setPosition(i,pos)
In this case the "i" is actually the length of the line renderer so it will have 64 points plotting on the graph.
However, I wanted it to reset the value when the size of length renderer (64) has reached and keep moving to the right, still showing the old plotting. Because for now, once it reach 64 points, the old plotting will disappear..
Appreciate any help!
i is the index of the point, so every time you add a new point, you increase i by one, I assume.
Why not simply keep increasing i further than 64 and continue plotting?
Hi, yes, I thought of that. But because I wanted the graph to be moving to the left every time a new data comes in, so I am not sure how to simulate that and at the same time, plotting continues..
Since you're using line renderer which renders lines in world space (in contrast to screen position), you can move your camera and that way change which part of the graph is displayed. So as you add points, simply move your camera to the right.
You'll need to be more detailed than that... what's wrong with it?