How to get 2D pos from 3D pos (mouse system)

Hy, anyone can help me? I want to make a mouse system calculated from CameraFrontVector's changes, but i don't know how to do the calculations...

Any functions? Or anything else?

Could you explain a bit more about what you're trying to do?

Do you want to be able to click on the ground or on a player/vehicle or anything in 3D space?

No i want to simply move the mouse... without any dialogs...

I'm trying to make a textdraw-mouse with an TXD mouse...

It is possible but it's complicated.
You need to get the player camera vector, I've checked the values it gives, when you look completely up, it gives 0.707106 (to the sky) and completely down (to the ground) it gives -0.964372 as Z coordinates. You need this to set the Y coordinates for the textdraw, on 0.707106 the mouse is at the edge above in the screen, and on -0.96 its at the edge below of the screen.

for the X coordinates of the textdraw you need to use the X and Y coordinates of the camera vector. This is more complicated because you can turn the camera all around, looking north gives X=0 and Y=1, East gives X=1 and Y =0, South is X=0 and Y=-1 and West gives X=-1 and Y = 0.

The calculation about checking in what direction it changed (to find the X for the textdraw) is quite complicated...

Thank you i'll check your post at saturday...

There's any function that help?

Any func?


i knew... but more? or codes?

Forum Jump:

Users browsing this thread: 1 Guest(s)