Jump to content
  • Advertisement
Sign in to follow this  
BearishSun

Screen space distance measurements

This topic is 3645 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

Hello and thanks for taking the time to read my post. I have a problem with measuring a screen space distance of a line, in a very specific way, as stated in 3D Game Engine Design book by David Eberly. After I have applied world, view and projection transform to my 2 line endpoints, Eberly states that you should apply this equation to transform to screen space(which makes perfect sense): x' = (Sx - 1)(x + 1)/2, y' = (Sy - 1)(y + 1)/2. Sx and Sy being the screen width and height. That equation is from a previous chapter, but in this current chapter he says that Q0(first line endpoint) = ((Sx - 1)(1 + x0/w0)/2, (Sy - 1)(1 + y0/w0)/2). And pretty much the same equation for the other endpoint, only with "w1". My question is, what the hell is "w0" and "w1", and why am I dividing with it? In previous chapters "w" was refered as w=z/n, n being the near plane distance. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
pure guess...could it be the width of the line????

Are you trying to do line to line collision detection?

if not what are you trying to do?

cheers.

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!