Sign in to follow this  

Transformed vertex question - Z

Recommended Posts

cebugdev    635
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,

Share this post

Link to post
Share on other sites
Krohm    5031
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
[quote][color="#1C2837"][size="2"]the X,Y coordinates are already in screen space right?[/size][/color][/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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this