Get coordinates of viewport boundaries

Hi! I am sorry, this may be a very noob question but I wasn’t able to find the answer elsewhere.

I have a Three canvas viewed by a perspective camera and I’d like to know the X and Y position of the four corners of the screen at the Z position zero.

Here’s a really stupid example - I have marked the four corners of which I’d like to know the position with a red circle for clarity.

Thanks!

This thread should help you with that.

Oh man!! That’s amazing, thank you so much (and thanks to @looeee for the function)!

1 Like