[DiscordArchive] XZY first is for what ? model position ?
[DiscordArchive] XZY first is for what ? model position ?
Archived author: Foe • Posted: 2022-11-13T21:28:16.709000+00:00
Original source
yep
Archived author: Intemporel • Posted: 2022-11-13T21:28:23.920000+00:00
Original source
But wait
Archived author: Intemporel • Posted: 2022-11-13T21:28:27.434000+00:00
Original source
There is a problem
Archived author: Intemporel • Posted: 2022-11-13T21:28:44.889000+00:00
Original source
QMouseEvent->pos() is (0;0) at top left not bottom left
Archived author: Intemporel • Posted: 2022-11-13T21:28:56.386000+00:00
Original source
you must reverse the screen pos y i think
Archived author: bandysc • Posted: 2022-11-13T21:29:02.124000+00:00
Original source
yup
Archived author: Kaev • Posted: 2022-11-13T21:29:09.370000+00:00
Original source
yeah bandysc mentioned that somewhere above
Archived author: Intemporel • Posted: 2022-11-13T21:29:35.592000+00:00
Original source
after that, this is looking good
Archived author: Kaev • Posted: 2022-11-13T21:32:01.393000+00:00
Original source
when do i need to do screenPos.y = 1 - screenPos.y;?
This is my calculation rn:
```c++
glm::mat4 VPmatrix = projection * view;
glm::vec4 screenPos = VPmatrix * glm::vec4(instance->pos, 1.0f);
screenPos.x /= screenPos.w;
screenPos.y /= screenPos.w;
screenPos.z /= screenPos.w;
screenPos.x = (screenPos.x + 1.0f) / 2.0f;
screenPos.y = (screenPos.y + 1.0f) / 2.0f;
screenPos.z = (screenPos.z + 1.0f) / 2.0f;
screenPos.x *= viewportWidth;
screenPos.y *= viewportHeight;
```
Archived author: Foe • Posted: 2022-11-13T21:32:40.836000+00:00
Original source
screenPos.y = (screenPos.y + 1.0f) / 2.0f; after this