LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: numberR on December 19, 2006, 05:36:54

Title: Mouse.getY() Value
Post by: numberR on December 19, 2006, 05:36:54
Hello guys,

I just noticed that a value returned by Mouse.getY() decrease (goes toward 0) as I move the mouse down, and it increases as I move the mouse up. Is this expected behavior?

If so, and if I want to get Y value to increase when I move the mouse down, do I need to keep track of DX?

Thanks.
Title: Re: Mouse.getY() Value
Post by: the2bears on December 19, 2006, 18:58:10
Quote from: numberR on December 19, 2006, 05:36:54
Hello guys,

I just noticed that a value returned by Mouse.getY() decrease (goes toward 0) as I move the mouse down, and it increases as I move the mouse up. Is this expected behavior?

If so, and if I want to get Y value to increase when I move the mouse down, do I need to keep track of DX?

Thanks.


This is expected behaviour, as it maps to OpenGL's coordinate system... 0,0 is the bottom left of the screen, with positive y being up.

edit: how about y = screenHeight - y ?

Bill
Title: Re: Mouse.getY() Value
Post by: numberR on December 20, 2006, 05:43:27
ahh, thanks!
i have a method to convert one coordinate system to OpenGL one, and was calling it twice for the cursor...