[DiscordArchive] so i can safely delete both screenPos.z lines?
[DiscordArchive] so i can safely delete both screenPos.z lines?
Archived author: Kaev • Posted: 2022-11-13T21:33:31.607000+00:00
Original source
so i can safely delete both screenPos.z lines?
Archived author: Foe • Posted: 2022-11-13T21:33:35.119000+00:00
Original source
yup
Archived author: Kaev • Posted: 2022-11-13T21:33:52.312000+00:00
Original source
```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.x = (screenPos.x + 1.0f) / 2.0f;
screenPos.y = (screenPos.y + 1.0f) / 2.0f;
screenPos.x *= viewportWidth;
screenPos.y *= viewportHeight;
screenPos.y = (screenPos.y + 1.0f) / 2.0f;
```
Archived author: Foe • Posted: 2022-11-13T21:34:06.648000+00:00
Original source
that seems a bit wrong
Archived author: Kaev • Posted: 2022-11-13T21:34:19.774000+00:00
Original source
I just did what u said
Archived author: Foe • Posted: 2022-11-13T21:34:52.111000+00:00
Original source
``` glm::mat4 VPmatrix = projection * view;
glm::vec4 screenPos = VPmatrix * glm::vec4(instance->pos, 1.0f);
screenPos.x /= screenPos.w;
screenPos.y /= screenPos.w;
screenPos.x = (screenPos.x + 1.0f) / 2.0f;
screenPos.y = (screenPos.y + 1.0f) / 2.0f;
screenPos.y = 1 - screenPos.y;
screenPos.x *= viewportWidth;
screenPos.y *= viewportHeight;```
Archived author: Kaev • Posted: 2022-11-13T21:35:28.993000+00:00
Original source
Ok i've done that
Archived author: Kaev • Posted: 2022-11-13T21:35:39.023000+00:00
Original source
And now i can just to the 2d aabb vs point test?
Archived author: Foe • Posted: 2022-11-13T21:35:48.354000+00:00
Original source
yep
Archived author: Foe • Posted: 2022-11-13T21:36:13.076000+00:00
Original source
I'm getting interface bounding box flashbacks from this code