[Include] Screen to World vice versa
#24

I use this:
pawn Код:
public OnCursorPositionChange(NewX, NewY)
{
    if(var == 1)
    {
        new Float:p[3];
        new Float:MX = (floatdiv(NewX, ScreenWidth) * 640.0);
        new Float:MY = (floatdiv(NewY, ScreenHeight) * 448.0);
        ScreenToWorld(0, MX, MY, p[0], p[1], p[2]);
        new Float:pp[3];
        //GetObjectPos(obj, pp[0], pp[1], pp[2]);
        SetObjectPos(obj, p[0], p[1], p[2]);
        //printf("%f, %f, %f", p[0], p[1], p[2]);
    }
    return 1;
}
and return this:
pawn Код:
[23:33:39] 0.114388, -1.017790, 0.300795
[23:33:39] 0.116575, -1.017659, 0.298849
[23:33:39] 0.119490, -1.017521, 0.296903
[23:33:39] 0.121676, -1.017390, 0.294958
[23:33:40] 0.120220, -1.017570, 0.297876
[23:33:40] 0.118034, -1.017812, 0.301767
[23:33:40] 0.117305, -1.017819, 0.301767
...
...

EDIT:

Example::

pawn Код:
ScreenToWorld(0, 600, 200, p[0], p[1], p[2]);

returns: 0.998540, -0.610018, -0.094856
Player ID 0 it's connected!.
Reply


Messages In This Thread
Screen to World vice versa - by Nero_3D - 09.12.2013, 21:43
Re: Screen to World vice versa - by Patrick - 09.12.2013, 21:50
Re: Screen to World vice versa - by Vinnyy - 10.12.2013, 01:54
Re: Screen to World vice versa - by Kar - 10.12.2013, 02:07
Re: Screen to World vice versa - by Sublime - 10.12.2013, 02:20
Re: Screen to World vice versa - by ViruZz - 10.12.2013, 04:25
Re: Screen to World vice versa - by kristo - 10.12.2013, 10:56
Re: Screen to World vice versa - by iJumbo - 10.12.2013, 11:05
Re: Screen to World vice versa - by Slice - 10.12.2013, 11:12
Re: Screen to World vice versa - by Vinnyy - 10.12.2013, 13:30
Re: Screen to World vice versa - by Kyle - 10.12.2013, 15:01
Re: Screen to World vice versa - by Vinnyy - 11.12.2013, 02:08
Re: Screen to World vice versa - by SkittlesAreFalling - 11.12.2013, 02:36
Re: Screen to World vice versa - by Kaperstone - 11.12.2013, 03:01
Re: Screen to World vice versa - by iZN - 11.12.2013, 06:17
Re: Screen to World vice versa - by Emmet_ - 11.12.2013, 11:22
AW: Re: Screen to World vice versa - by Nero_3D - 11.12.2013, 17:11
Re: AW: Re: Screen to World vice versa - by Vinnyy - 12.12.2013, 03:15
AW: Screen to World vice versa - by LeBoyce - 12.12.2013, 15:37
Respuesta: Screen to World vice versa - by adri1 - 14.06.2014, 20:34
AW: Respuesta: Screen to World vice versa - by Nero_3D - 14.06.2014, 21:10
Re: Screen to World vice versa - by VladimirMark - 14.06.2014, 21:31
Re: Screen to World vice versa - by MacT - 18.06.2014, 20:45
Respuesta: Screen to World vice versa - by adri1 - 21.06.2014, 21:10
AW: Screen to World vice versa - by Nero_3D - 21.06.2014, 23:42
Respuesta: Screen to World vice versa - by adri1 - 22.06.2014, 15:14
AW: Respuesta: Screen to World vice versa - by Nero_3D - 22.06.2014, 17:19
Respuesta: Screen to World vice versa - by adri1 - 22.06.2014, 17:23
Re: Screen to World vice versa - by iRaiDeN - 22.06.2014, 19:33
AW: Respuesta: Screen to World vice versa - by Nero_3D - 23.06.2014, 16:07
Re: Screen to World vice versa - by codectile - 04.06.2015, 09:38

Forum Jump:


Users browsing this thread: 2 Guest(s)