Hey guys,
i need to draw Vitals such as ECG heart rate… for example:
do you know what is the best practice to draw such graphs?
do i have to use math functions and draw it ? or there’s another solutions?
Do you know any open source solution that i can use?
I’d love to get help with it…
“feed it some points” - that is exactly what i asked…
the collection of points is eventually the math function on the graph, and i want to know what is the best way to draw a mathematical function- using that LineRenderer?
Vector3[] points = new Vector3[ MAX];
for (int i = 0; i < points.Length; i++)
{
float x = ConvertIndexToDomain( i);
float y = YourMathematicalFunctionHere( x);
points[i] = new Vector3( x, y);
}
TheLineRenderer.SetPositions( points);
Everything else is scaling or offsetting and whatever UI work you want. There are ten billion UI tutorials out there to help you.
This pattern, iterating to produce a range of inputs and feeding them through a function and recording the outputs in some kind of collection should become like eating, walking, falling off a bicycle. It’s that fundamental to how computer data processing works.