1. ## GL ES 2.0: which clip coord. after Vertex Shader?

Hello, I'm reading OpenGL ES 2.0 Programming Guide and have a question regarding clip coordinates as mentioned in the subject here: according to Figure 7.7 the Vertex Shader receives Object Coordinates and shall output clip coordinates. I understand object coordinates to be my own personal coordinates however I define them and I now need to output clip coordinates for the next step in the pipeline. My object coordinates are cartesian coordinates with the camera lens being in the origin. The screen plane is at y=-h (righthanded ocs). How do the Clip coordinates have to Look like for an object vertice at x,y,z ? I searched but didn't find a definitive answer. Thanks.

2. ## Re: GL ES 2.0: which clip coord. after Vertex Shader?

I try to make the question more clear.

How does a Clip Coordinate look like for a traditional cartesian coordinate?

3. ## Re: GL ES 2.0: which clip coord. after Vertex Shader?

Clip coordinates are what you get after applying modelview and projection matrix (before perspective division):

Code :
`p_clip = M_proj * M_mv * p_obj`

where p_clip is a point in clip coordinates, M_proj is the projection matrix, M_mv is the modelview matrix and p_obj is a point in object coordinates.

4. ## Re: GL ES 2.0: which clip coord. after Vertex Shader?

Thank you. Unfortunately the only results from googling opengl modelview matrix appearing to fit (OpenGL FAQs) are unspecific. I figured I have to deliver clip coordinates as output from the Vertex Shader. As I do the transform in the VS (no fixed-function) I can use any input coordinates as long as I deliver Clip coordinates of these input coordinates.

I still don't know how a cartesian coordinate (R^3) should look like as a clip coordinate.

How does the required clip coordinate space look like in R^3?

Thanks!

5. ## Re: GL ES 2.0: which clip coord. after Vertex Shader?

Hmm, FAQ 9.011 does not help?

Clip coordinates are a homogeneous coordinate system (x,y,z,w) so that it is possible to express a perspective projection with a 4x4 matrix and division by w.
Other than that they don't "look" special in any way, it's just 4 values expressing a position in a left handed (usually orthogonal) homogeneous coordinate system - at least I think it is already left handed, at some point the z-axis is flipped around and I think the projection matrix already does it.

Ultimately it's just the two matrices applied to your input coordinates. If you are unclear about what kind of transformations are expressed with these two matrices I'd suggest working through a tutorial that explains how these transforms are usually used, e.g. chapters 3&amp;4 of http://www.arcsynthesis.org/gltut.

6. ## Re: GL ES 2.0: which clip coord. after Vertex Shader?

Hi, that FAQ didn't help. I read I.1.Following the Data.Vertex Transfer of your link though. This helped. To answer my question: cartesian coordinates + 4th component 1.0 are Clip coordinates already (pending axis mapping). Reading Wikipedia about homogenous coordinates got me the impression h.c. might be non-orthogonal radial inside a pyramidal frustrum. Thank you.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•