Jump to content
  • Advertisement
Sign in to follow this  

Transformed vertex question - Z

This topic is 2561 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!