OpenGL Coordinate system names

Quick question about the proper terminology with regards to OpenGL Coordinate System names

I know that a system whose limits are [0, 1] is named Device Coordinates
A system whose limits are [-1, 1] is named Normalized Device Coordinates
A system whose limits are based on the view matrix is named View Space
A system whose limits are based on the world matrix is named World Space

If this is correct so far, what about a system with a limit of [0, screen size] is named what? What would be called Screen space?

Is there a resource on this? I enjoy learning this proper terminology.

Window coordinates, right? At least that’s what I remember seeing when I was reading the OpenGL book…

Think of it like this

An object resides in object space

When it is multiplied by the model matrix it is transformed to world space

When this world space view is multiplied by the view matrix it transforms to eye space

When this eye space is multiplied by the projection matrix it transforms to clip space

Dividing this clip space by the w component gives you normalised clip space which is [-1,1]. Direct 3D has the z component as [0,1] but x and y are [-1,1]. When you want to visualise the depth buffer in opengl you normally convert from [-1,1] to [0,1] by doing z * 0.5 + 0.5 because the Color range goes from 0 to 1.

You can move from one space to another by reversing the transformation at each stage

A few things:

First:

[quote]A system whose limits are [-1, 1] is named Normalized Device Coordinates…
[/quote]
The implication of this sentence is somewhat strange. It is like saying: “an object whose color is red is a car.”

You can turn that sentence around, and then it’ll make sense:
“The Normalized Device Coordinates in OpenGL is a coordinate system whose limits are [-1, 1].”

and even that sentence would be too vague and without context, because a coordinate system per se has no “limits”.
A more correct way of saying would be: “The Normalized Device Coordinates in OpenGL is a coordinate system in which drawn primitives with X, Y or Z vertex coordinates outside of the boundaries [-1, 1] are clipped at these boundaries.”
and even that sentence is pretty imprecise and still leaves a lot of questions unanwered.

Second:

By definition there is no such thing as the “Device Coordinates”. Since you seem to be wanting a definitive answer on all of this naming, the best reference here would be the OpenGL specification. See for example chapter 13.6 “Coordinate Transformations” of the OpenGL 4.5 Core Specification.

You’ll see that OpenGL only really defines three coordinate systems:

  • Clip Coordinates
  • Normalized Device Coordinates
  • Window Coordinates
    You can replace “Coordinates” with “Coordinate System” or “Space” in the above names. All of those are somewhat used synonymously.

Third:

[quote]A system whose limits are based on the view matrix is named View Space
[/quote]
This is somewhat vague, since it depends on what exactly we mean by “based on”.
First of all: What exactly do most people mean by “View Space”? By convention, it is the space where the origin will project to the center of the viewport/screen with the +X axis pointing to the right, the +Y axis pointing upwards and the +Z axis pointing out of the screen towards the user.
Now onto “based on”: A matrix does not per se define a coordinate system. A matrix in OpenGL represents a transformation between any two coordinate systems. And that is what we can say “based on” to mean in your sentence: The View Space is the space we transform our vertices into when applying the “view matrix” on them. The source coordinate system from which we transform our vertices into view space via the view matrix is by convention the “World Space”.
Also, “View Space” is sometimes called “Eye Space” or “Camera Space”.

[quote]A system whose limits are based on the world matrix is named World Space
[/quote]
There is no “world matrix”. But, of course, since everything here is by convention, you can define what that means for you. But usually by convention people call this the “model matrix”, which is used to transform vertices from “model space” into “world space”.
And “model space” is the space in which your vertices are defined when you specify them to OpenGL (for example via a vertex buffer object).

What “world space” means exactly however has no definition. It just serves as a coordinate system that you can use in a useful way for all entities in your world to share a single coordinate system, which in turn allows you to transform them into view space and eventually clip space via a single transformation matrix.

Fourthly and lastly:

Remember that the coordinate systems/spaces “View Space”, “World Space” and even “Model Space” are all by convention. You’ll find “modern” OpenGL specifications mentioning them nowhere. With “modern” OpenGL, the only coordinate system that actually matters the most (because it is the only interface between OpenGL and the client), is the “Clip Coordinates”.

abcdef, I’m well aware of the functionality of everything I described. I’ve been doing graphics programming (albeit self taught) for quite awhile now. I was just looking for definitions out of curiosity!

Thanks for the explanation, Kai :slight_smile: Was exactly what I was looking for.