Clip coordinates

{{Short description|Coordinate system used in computer graphics}}

The clip coordinate system is a homogeneous coordinate system in the graphics pipeline that is used for clipping.{{cite book|author1=Dave Shreiner|author2=OpenGL Architecture Review Board|title=OpenGL programming guide: the official guide to learning OpenGL, version 2|url=https://books.google.com/books?id=glIuQwAACAAJ|accessdate=29 December 2011|year=2006|publisher=Addison-Wesley|isbn=978-0-321-33573-9}}

Objects' coordinates are transformed via a projection transformation into clip coordinates, at which point it may be efficiently determined on an object-by-object basis which portions of the objects will be visible to the user. In the context of OpenGL or Vulkan, the result of executing vertex processing shaders is considered to be in clip coordinates.{{cite web|url=https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf|title=OpenGL 4.6 Core Profile|date=May 14, 2018|first1=Mark|last1=Segal|first2=Kurt|last2=Akeley|publisher=The Khronos Group}}{{cite web|url=https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html|title=Vulkan® 1.0.98 - A Specification|author=The Khronos® Vulkan Working Group|publisher=The Khronos Group|date=January 13, 2019|accessdate=January 23, 2019}} All coordinates may then be divided by the w component of 3D homogeneous coordinates, in what is called the perspective division.

More concretely, a point in clip coordinates is represented with four components,

:\begin{pmatrix}x_c\\y_c\\z_c\\w_c\end{pmatrix},

and the following equality defines the relationship between the normalized device coordinates x_n, y_n and z_n and clip coordinates,

:\begin{pmatrix}x_n\\y_n\\z_n\end{pmatrix} = \begin{pmatrix}x_c / w_c\\y_c / w_c\\z_c / w_c\end{pmatrix}.

Clip coordinates are convenient for clipping algorithms as points can be checked if their coordinates are outside of the viewing volume. For example, a coordinate x_c for a point is within the viewing volume if it satisfies the inequality -w_c \leq x_c \leq w_c.{{cite web|url=https://www.khronos.org/opengl/wiki/Vertex_Post-Processing|title=Vertex Post-Processing|publisher=The Khronos Group|accessdate=January 23, 2019}} Polygons with vertices outside of the viewing volume may be clipped to fit within the volume.

Clipping algorithms

References

{{Reflist}}

{{DEFAULTSORT:Clip Coordinates}}

Category:Clipping (computer graphics)

{{Compu-graphics-stub}}