{"name":"get3DENCamera","operator":null,"title":"get3DENCamera","type":"command","url":"https://community.bistudio.com/wiki/get3DENCamera","revid":369318,"updated":"2024-09-03T18:42:56Z","groups":["Eden Editor"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.56"}],"since":{"game":"arma3","name":"Arma 3","version":"1.56"},"arma3_since":"1.56","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns the camera Object used by the Eden Editor.","syntaxes":[{"syntax":"get3DENCamera","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Object","types":["Object"],"description":"Eden Editor camera","text":"Object - Eden Editor camera"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\n// set exact yaw, pitch, and roll\n_y = 45; _p = -80; _r = 0;\nget3DENCamera setVectorDirAndUp [\n    [sin _y * cos _p,cos _y * cos _p,sin _p],\n    [[sin _r,-sin _p,cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D\n];\n```","code":["// set exact yaw, pitch, and roll\n_y = 45; _p = -80; _r = 0;\nget3DENCamera setVectorDirAndUp [\n\t[sin _y * cos _p,cos _y * cos _p,sin _p],\n\t[[sin _r,-sin _p,cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D\n];"]},{"text":"```sqf\n//Look at player\n_a = positionCameraToWorld [0,0,0] vectorFromTo (getPosATL player);\n_y = asin(_a select 0);\n_b = [_a,_y] call BIS_fnc_rotateVector2D;\n_z = _b select 2;\n_p = asin(_z / sqrt((_b select 1)^2 + _z^2));\nget3DENCamera setVectorDirAndUp [\n    _a,\n    [[0,-sin _p,cos _p],-_y] call BIS_fnc_rotateVector2D\n];\n```","code":["//Look at player\n_a = positionCameraToWorld [0,0,0] vectorFromTo (getPosATL player);\n_y = asin(_a select 0);\n_b = [_a,_y] call BIS_fnc_rotateVector2D;\n_z = _b select 2;\n_p = asin(_z / sqrt((_b select 1)^2 + _z^2));\nget3DENCamera setVectorDirAndUp [\n\t_a,\n\t[[0,-sin _p,cos _p],-_y] call BIS_fnc_rotateVector2D\n];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["move3DENCamera","set3DENAttributes"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Eden Editor","Introduced with Arma 3 version 1.56","Scripting Commands"]}