
NDC (normalized device coordinates) is a term you may have heard while working with computer graphics or OpenGL. Don’t be put off by the complexity; it will make sense once you untangle it.
This article will explore what normalized device coordinates are, their purpose, and their operation.
What Are Normalized Device Coordinates?
Normalized Device Coordinates are coordinates used to represent a device’s current position or orientation.
Normalized Device Coordinates are the results after transforming a set of points in 3D space in computer graphics. They can be included when working with systems such as OpenGL or DirectX.
The x, y, and z coordinates in NDC are mapped so that each range is within a standard size.
- x goes from -1 to 1.
- y: its values cover from -1 to 1.
- Z can be set from -1 to 1 in OpenGL, or from 0 to 1 in DirectX.
The graphics system can tell where to display a point with these values.
Why Should Normalized Device Coordinates Be Used?
Using an output range from −1 to 1 is helpful for graphics systems.
Display the same content regardless of how big or small the screen is.
Evaluate what things can be seen by the camera.
Change 3D models into standard 2D images.
At which point is NDC used in graphics pipelines?
Stage | Description |
Model Space | Object’s original coordinates |
World Space | Object’s position in the world |
View Space | Scene from the camera’s point of view |
Clip Space | Coordinates after applying projection |
NDC | Clip coordinates divided by w to fit -1 to 1 range |
Screen Space | Final pixel positions on the screen |
An illustration of Normalized Device Coordinates.
- Suppose a point has clip coordinates (2, 4, 6, 2). To change from NAEDT to NDC.
- NDC is the same as (1, 2, 3).
- The x coordinate is the only one within -1 to 1, which makes the point invisible.
Final Thoughts
The use of normalized device coordinates allows for the correct display of 3D graphics on 2D screens. They ensure drawings appear the same regardless of whether the screen is large or small.
Knowing about NDC is essential to understanding how a graphics engine renders objects. Continue practicing by using real-life examples.