Timeline for How do I get the size of a Plane in pixels and set it multiplied by some factor to be the size of a Sphere?
Current License: CC BY-SA 4.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 15, 2020 at 10:31 | comment | added | silviubogan | I asked a new question here. Thank you. | |
| Jan 15, 2020 at 9:28 | vote | accept | silviubogan | ||
| Jan 14, 2020 at 15:15 | comment | added | troien |
If you want to place the camera so that it always fits a plane, I'd suggest asking a new question, as then other people who want to do the same can find it more easy. (but first check if someone else asked that question already). To have the sphere have a radius relative to the plane behind it is in my answer I think. Giving the sphere a scale of [10,10,10] gives it the same size as the plane. Where the formula for scale would be: float scale = 10/numberOfSpheresWantedOnPlane; and then GameObject.Find("Sphere").transform.localScale = new Vector3(scale, scale, scale);.
|
|
| Jan 14, 2020 at 14:56 | comment | added | silviubogan | I have a camera and I wish to resize the sphere to have a radius relative to the plane behind it. The plane can get bigger or smaller. I could compute the size of the sphere in the same place where I compute the size of the plane. The problem I'm facing is that when I compute the size of the plane I must move the camera so that it sees the entire plane. I am working with the field of view of the camera and its position but I do not know how to do it. Should I ask a separate question? I think it is simple math... something with sin and cos. Thank you very much! | |
| Jan 14, 2020 at 14:24 | history | answered | troien | CC BY-SA 4.0 |