[DiscordArchive] Does that look right?
[DiscordArchive] Does that look right?
Archived author: Kaev • Posted: 2022-11-13T20:47:45.056000+00:00
Original source
Does that look right?
![[Image: image.png?ex=690c60d0&is=690b0f50&hm=7e7...4ccfc5df9&]](https://cdn.discordapp.com/attachments/415944535718494208/1041454478416691371/image.png?ex=690c60d0&is=690b0f50&hm=7e76fbcb92a110ab4361ddfb287b76d4fbdc554a4b087b8dbf032c04ccfc5df9&)
Archived author: Kaev • Posted: 2022-11-13T20:48:17.011000+00:00
Original source
```
224496 - (World.cpp:3014): [Error] x: 30225.58789 z: 31737.96875 y: -0.00000
224496 - (World.cpp:3015): [Error] screen pos x: -0.90100 z: 0.85718 y: -0.97335
```
![[Image: image.png?ex=690c60d0&is=690b0f50&hm=7e7...4ccfc5df9&]](https://cdn.discordapp.com/attachments/415944535718494208/1041454478416691371/image.png?ex=690c60d0&is=690b0f50&hm=7e76fbcb92a110ab4361ddfb287b76d4fbdc554a4b087b8dbf032c04ccfc5df9&)
Archived author: Foe • Posted: 2022-11-13T20:48:22.424000+00:00
Original source
The horrors of blizz interface coordinates
Archived author: Pursche • Posted: 2022-11-13T20:54:39.970000+00:00
Original source
Yes I think this looks more or less correct, at least on my small phone screen
Archived author: Kaev • Posted: 2022-11-13T20:55:03.270000+00:00
Original source
nice
Archived author: Pursche • Posted: 2022-11-13T20:55:06.440000+00:00
Original source
So now we have a screenpos between -1 and 1 on both axises.
Archived author: Pursche • Posted: 2022-11-13T20:56:07.648000+00:00
Original source
We do (x+1.0f)/2.0f to convert it to 0 to 1, and then we want to multiply it with the resolution of the viewport to get the pixel coordinate
Archived author: Kaev • Posted: 2022-11-13T20:57:35.401000+00:00
Original source
screenPos.x = (screenPos.x + 1.0f) / 2.0f;
screenPos.y = (screenPos.y + 1.0f) / 2.0f;
screenPos.z = (screenPos.z + 1.0f) / 2.0f;
like that?
Archived author: Pursche • Posted: 2022-11-13T20:59:12.709000+00:00
Original source
Yes, that converts from -1 .. 1 to 0 .. 1.
Archived author: Pursche • Posted: 2022-11-13T20:59:13.524000+00:00
Original source
Then multiply by the resolution of the viewport, for example 1920x1080