How do I convert coordinates for a line render to draw within the scale of a UI panel?
I have an array of x,y positions that are in world space. I know what the min and max of these positions are. I want to map these positions so that when put into a line renderer it will draw the line within the bounds of a panel on the UI (we're talking essentially just a rect transform on the UI).
The line renderer is a component of an empty child object which is a child of the panel.
I've been trying a lot of silly stuff that hasn't even come close to working and was hoping someone else might be able to understand the math better than me. I know that 'scaling' needs to happen where the data is mapped into the range of the rect transform. And then some sort of conversion needs to happen so that the points are in screen space and in the local space of the panel (the line renderer seems to always draw in world space). Each of these things alone I thought I knew how to do but I'm messing stuff up trying to do all of them.
I appreciate any help or advice.
Your answer
Follow this Question
Related Questions
How do I draw line on panels and canvas? 0 Answers
UI issue, stretching 0 Answers
A line between two objects with conditions 0 Answers
Slide-Out Panel Animates on Button - How to Animate on Swipe Motion on Mobile? 1 Answer
Unity Linerenderer jaggy lines 0 Answers