finding the radius of a cylinder based on camera position

130 Views Asked by At

Not entirely sure this is the right forum, but I'll give it a go.

I have a cylinder that is projected onto a 2d plane (3d world with a virtual camera).

What I want to figure out is, given a point on the 2d viewing plane, how large does the cylinder need to be in order for it's "edge" to align with said point

enter image description here

Basically from that image: given the red point how much larger does the cylinder have to be? (the blue line)

1

There are 1 best solutions below

1
On

If you mean the bottom of the cylinder reaching the red point, you need 'Pythagoras Theorem'.

Just ignore the height of the cylinder.
You can then work out its required radius (AB), in the 2D plane like this enter image description here


Alternatively, if you mean that the cylinder should be enlarged to reach the dotted blue line, then it should be $4$ times the radius, going from a radius of $5$ to $20$, so the radius should be increased by $15$ units (green line)

enter image description here