erpeo93
57 posts
None 
#16333
[openGL] unproject problem 7 months, 1 week ago Edited by erpeo93 on Sept. 15, 2018, 9:53 a.m.
Hi,
today I was trying to unproject my mouse position to see where it is in world space. Here it is the unproject function:
It seems to work fine when the camera is perfectly aligned with the world Z Axis (0, 0, 1): (you can see the red rectangle perfectly fits the screen) https://ibb.co/iejA9z but as soon as I start rotating the camera it doesn't work anymore, as it seems it is still using the straight up camera. https://ibb.co/msPXNK Assuming the problem is not in the camera matrixes (checked multiple times both the forward and back matrixes), I think the problem should be _somewhere_ in this function, but I really can't see it. Can you guys give me a little help with this? Thank you, Leonardo None 
erpeo93
57 posts
None 
#16337
[openGL] unproject problem 7 months ago
Figured it out!
I have to grab the W coordinate from the "forward" projection as well as the Z coordinate:
Problem solved. :) None 
gnflk
1 posts

#17078
[openGL] unproject problem 3 months, 3 weeks ago
I'm assuming
What is parameter

mmozeiko
Mārtiņš Možeiko
1916 posts
/ 1 project

#17084
[openGL] unproject problem 3 months, 3 weeks ago Edited by Mārtiņš Možeiko on Dec. 29, 2018, 1:24 a.m.
Inverse camera view matrix (camera space to world space transform).
