(Screen 2D) -> (3D Points with specified distance)
#1

Trigonometry experts, how would I do that?

What I have:

- X and Y Position in the screen.
- Width x Height, Resolution of screen in pixels (to roughly calculate player's field of view)

What I want:

- X,Y,Z in 3D Space with a distance specified by myself.

The function should look like this:
pawn Код:
ScreenToWorld(Float:ScreenX, Float:ScreenY, Float:Distance, &Float:X, &Float:Y, &Float:Z)
Consider this function already made:
pawn Код:
GetScreenResolution(playerid, &Float:Width, &Float:Height);
Reply
#2

Would something like this?

pawn Код:
ScreenToWorld(ScreenX, ScreenY, 30, &Float:X, &Float:Y, &Float:Z)
Reply
#3

Yes but in the image, the XYZ is in wrong place, it's supposed to be behind the screen xy.
Reply
#4

I'm really interessted in something like this, but idk how to realize that. Somebody already found a solution to transform Positions between 2D and 3D?
Reply
#5

lol.. this is not that simple
Reply
#6

sht.. man
Reply
#7

There a several complications to this. The coordinates of the player's camera updates slowly and
the world's objects (including terrain) are not calculated by the server, so you'll need a height map which will make it even more inaccurate
Reply
#8

Quote:
Originally Posted by Joe Staff
Посмотреть сообщение
There a several complications to this. The coordinates of the player's camera updates slowly and
the world's objects (including terrain) are not calculated by the server, so you'll need a height map which will make it even more inaccurate
3d to 2d u dont have to worry about height map
i think thats unimportant the most hard stuff is the convertion
Reply
#9

The thread is one year old though, the OP might solved it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)