Graphics::screen2dToWorld3d: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
m (inverted function reference)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Returns world position from screen position
Returns world position from screen position
Inverted function: [[Graphics::world3dToScreen2d]]
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
Line 9: Line 11:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
let pos3d = mp.game.graphics.screen2dToWorld3d(new mp.Vector3(0.5, 0.5, 0));
let pos3d = mp.game.graphics.screen2dToWorld3d(new mp.Vector3(screenX, screenY, 0));
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==

Latest revision as of 19:25, 22 August 2020

Returns world position from screen position

Inverted function: Graphics::world3dToScreen2d

Syntax

mp.game.graphics.screen2dToWorld3d(coords2d);

Required Arguments

  • Vector3: 2d coord

Return value

  • position: Vector3

Example

let pos3d = mp.game.graphics.screen2dToWorld3d(new mp.Vector3(screenX, screenY, 0));

See also