Transformed vertex question - Z

Started by
0 comments, last by Krohm 12 years, 11 months ago
Hi, Im just confused when using transformed vertex (the one with RHW on it), why are some people prefered to use 0.5 as value for its Z component instead of 1.0f? will it matter? the X,Y coordinates are already in screen space right? Just confused.. :) Thanks,
Advertisement
Assuming you're talking about Ortho for 2D...
then the Z is irrelevant when it comes to appearance/position of the point. It can be any value. As long as it gets transformed between near and far sides of the cube.
Some people use 0.5 because using edge bounduaries (assuming they set far=1.0) might be subject to some FP error. I personally never had this problem myself.

But you seem to not understand much. I suggest to either check your theory from scratch or write better questions (some context information is always appreciated). Nobody says XY is in "screen space" so
[color="#1C2837"]the X,Y coordinates are already in screen space right?[/quote]The answer is (in general) "absolutely not". Those are object-space values, whatever they become after you send them to the pipe is up to you. Given the appropriate transformation matrix (ortho) they will end up matching screen space positions "somehow".

In your very specific case, yes, you can likely consider them equivalent. In your case.

Previously "Krohm"

This topic is closed to new replies.

Advertisement