# Get coordinates of viewport boundaries

**URL:** <https://discourse.threejs.org/t/get-coordinates-of-viewport-boundaries/21031>\
**Category:** Questions\
**Tags:** camera, math\
**Created:** [November 26, 2020, 4:22pm UTC](https://discourse.threejs.org/t/get-coordinates-of-viewport-boundaries/21031 "2020-11-26T16:22:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xQ74R2Vf](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/xq74r2vf/32/14796_2.png) [@xQ74R2Vf](https://discourse.threejs.org/u/xQ74R2Vf)\
**Post date:** [November 26, 2020, 4:22pm UTC](https://discourse.threejs.org/t/get-coordinates-of-viewport-boundaries/21031/1 "2020-11-26T16:22:33Z")

</div>

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.

[![](https://i.imgur.com/UDhCv5g.png) ](https://i.imgur.com/UDhCv5g.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [November 26, 2020, 5:22pm UTC](https://discourse.threejs.org/t/get-coordinates-of-viewport-boundaries/21031/2 "2020-11-26T17:22:22Z")

</div>

[This thread](https://discourse.threejs.org/t/functions-to-calculate-the-visible-width-height-at-a-given-z-depth-from-a-perspective-camera/269/20) should help you with that.

---

<div class="post-metadata">

**Author:** ![xQ74R2Vf](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/xq74r2vf/32/14796_2.png) [@xQ74R2Vf](https://discourse.threejs.org/u/xQ74R2Vf)\
**Post date:** [November 26, 2020, 8:52pm UTC](https://discourse.threejs.org/t/get-coordinates-of-viewport-boundaries/21031/3 "2020-11-26T20:52:41Z")

</div>

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