# How to calculate how many screen pixels represent one world coordinate unit?

**URL:** <https://discourse.threejs.org/t/how-to-calculate-how-many-screen-pixels-represent-one-world-coordinate-unit/3560>\
**Category:** Questions\
**Created:** [July 26, 2018, 5:57pm UTC](https://discourse.threejs.org/t/how-to-calculate-how-many-screen-pixels-represent-one-world-coordinate-unit/3560 "2018-07-26T17:57:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Fyrestar](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fyrestar/32/52793_2.png) [@Fyrestar](https://discourse.threejs.org/u/Fyrestar)\
**Post date:** [July 26, 2018, 6:01pm UTC](https://discourse.threejs.org/t/how-to-calculate-how-many-screen-pixels-represent-one-world-coordinate-unit/3560/2 "2018-07-26T18:01:33Z")

</div>

If it’s about perspective and depth then this function will help, otherwise you should provide more information.

> [@Functions to calculate the visible width / height at a given z-depth from a perspective camera](https://discourse.threejs.org/t/functions-to-calculate-the-visible-width-height-at-a-given-z-depth-from-a-perspective-camera/269):
>
> These two functions will give you the visible height and width in your scene at a given distance from a PerspectiveCamera. It’s useful if you want to create an object that is the full width / height of the scene, or want to place objects at screen edges etc. Here’s the code (ES6): const visibleHeightAtZDepth = ( depth, camera ) =\> { // compensate for cameras not positioned at z=0 const cameraOffset = camera.position.z; if ( depth \< cameraOffset ) depth -= cameraOffset; else depth += c…

---

_[View the full topic](https://discourse.threejs.org/t/how-to-calculate-how-many-screen-pixels-represent-one-world-coordinate-unit/3560)._
