1
votes

when we calculate normalized device coordinates from clip coordinates using perspective division, do we divide by absolute value of w component or signed value? because we might have negative xyz coordinates and if w is negative then NDC will be positive values.

1

1 Answers

3
votes

Conceptually, the division is done with w as is, not the absolute value. This will also result in the correct mathematical projection: the straight line connecting the point of interest and the center of projection is intersected with image plane, so objects "behind" the projection center will appear mirrored.

However, that division is done after clipping (that's why clip space is called clip space, after all). So for practical purposes, you will not encounter a vertex with w <= 0 at that stage.