Skip to main content
edited body
Source Link
xoric
  • 175
  • 1
  • 11

I haveam programming on a little LWJGL applicationproject and I have been trying to figure out how to successfully use the GLU.gluUnProject function in order to transform a given point on the screen (mouse position) to world coordinates. I found several examples on Google and really tried hard to get it to work. I do manage to get a result vector but the values it gives me make no sense.

I have a little LWJGL application and I have been trying to figure out how to successfully use the GLU.gluUnProject function in order to transform a given point on the screen (mouse position) to world coordinates. I found several examples on Google and really tried hard to get it to work. I do manage to get a result vector but the values it gives me make no sense.

I am programming on a LWJGL project and have been trying to figure out how to successfully use the GLU.gluUnProject function in order to transform a given point on the screen (mouse position) to world coordinates. I found several examples on Google and really tried hard to get it to work. I do manage to get a result vector but the values it gives me make no sense.

typo
Source Link
xoric
  • 175
  • 1
  • 11

None of the three resulting coordinates makes sense to me. As far as I can tell x should be somewhere around 240 (each tile in the scene is of size 120 x 80 pixels). It should definatelydefinitely be positive though and not -0.0580 or -0.0208.

None of the three resulting coordinates makes sense to me. As far as I can tell x should be somewhere around 240 (each tile in the scene is of size 120 x 80 pixels). It should definately be positive though and not -0.0580 or -0.0208.

None of the three resulting coordinates makes sense to me. As far as I can tell x should be somewhere around 240 (each tile in the scene is of size 120 x 80 pixels). It should definitely be positive though and not -0.0580 or -0.0208.

Tweeted twitter.com/#!/StackGameDev/status/636358691109892096
Reupload images from imageshack to stack.imgur before they get replaced by ads; see http://meta.stackexchange.com/q/263771
Source Link
Vaillancourt
  • 16.3k
  • 17
  • 55
  • 61

screen capture http://img819.imageshack.us/img819/9452/as8k.jpgscreen capture

I rewrote the code several times using different implementations of other people but could not get it to work. Maybe somebody could give me a hint. What I am doing wrong?

Thanks a lot for any advice or link of any kind! I really appreciate your help!

Greetings Xoric

screen capture http://img819.imageshack.us/img819/9452/as8k.jpg

I rewrote the code several times using different implementations of other people but could not get it to work. Maybe somebody could give me a hint. What I am doing wrong?

Thanks a lot for any advice or link of any kind! I really appreciate your help!

Greetings Xoric

screen capture

I rewrote the code several times using different implementations of other people but could not get it to work. Maybe somebody could give me a hint. What I am doing wrong?

edited title
Link
xoric
  • 175
  • 1
  • 11
Loading
Source Link
xoric
  • 175
  • 1
  • 11
Loading