# Screen space distance measurements

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

## 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 on other sites
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.

1. 1
Rutin
64
2. 2
3. 3
4. 4
5. 5

• 16
• 10
• 29
• 20
• 9
• ### Forum Statistics

• Total Topics
633414
• Total Posts
3011764
• ### Who's Online (See full list)

There are no registered users currently online

×