Here is what I am trying to achieve by calculous:
It’s a VR scene, with the head located at point O in the image. I want to assemble a list of text panels from top to bottom in a rounded fashion. The panels each have a RectTransform, and a local position relative to the head (O). I succeded in placing the center of the panels around like in the picture, but my problem is adjusting the edges (size of the RectTransform) of the panels.
I tried to get the corners of the panels in local space with the function RectTransform.GetLocalCorners, but I get incoherent positions: my x,y,z positions in local space of the yellow gizmos symbolizing the center of the panels are about [0, 0.7, 0.4] (and the second one is at [0, 0.57, 0.57])
and my corners are (-14, -25, 0), to (14, 25, 0) for the first panel. So my guess is they do not share the same reference.
I do actually have a scale to my rect transform (in order for the text to look good at the right size): the scale is (0.01, 0.01, 1). I think it might be the reason why I get my corners with absurd values. But maybe it’s also because Unity gives me the corners relative to a 2D plane. I think it gives me the position of the corners relative to the yellow centers, but in 2D, and with another scale.
How can I adjust the edge of the RectTransforms in order to put the corners at the exact 3D local position (relative to O) I want?
Edit
I think my question wasn’t clear enough on what I did and didn’t do.
I already placed all my panels at the right places (local position), and already have the right rotations (local rotation). But my problem is finding the size of the “quad” (or in my case RectTransform, because I use TextMesh Pro) for my text.
I don’t know the size because I change the number of panels and the distance to the observer programmatically (according to the text I want to display), so I want to calculate it so that each panel border touches exactly the next panel border.
Actually, I even have a formula for all my corners/size in 3D space, but my problem is converting it to “quad size” or “RectTransform size”.
I don’t know if it’s possible.